Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip machine tests if they don't need to be run #22620

Merged

Conversation

edsantiago
Copy link
Member

Followup to #13936 : add an exclusion to localmachine tests
so we can avoid running those on test- or doc-only PRs.
Reason: #22551, the machine-start-timeout flake, is causing
hours of wasted time.

Signed-off-by: Ed Santiago [email protected]

None

Followup to containers#13936 : add an exclusion to localmachine tests
so we can avoid running those on test- or doc-only PRs.
Reason: containers#22551, the machine-start-timeout flake, is causing
hours of wasted time.

Signed-off-by: Ed Santiago <[email protected]>
Copy link
Contributor

openshift-ci bot commented May 6, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: edsantiago

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 6, 2024
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM things like this are on my TODO list for the CI work.
You don't have to answer this here right now but I like to understand why this was implemented like this and not via skip/only_if in cirrus.yml. IMO this currently violates POLA as users wrongly assume the tests have been run even when they are not.

@edsantiago
Copy link
Member Author

Oh, huh. I thought it had been explained in #13936, but no.

Basically: yes, in an ideal world this would be done in .cirrus.yml. In this world, that is impossible. See the _bail_etc function for details. Can you find a way to implement that in YAML?

Side note: Cirrus apparently has some sort of other scripting language, starlark, that can replace .cirrus.yml and that provides more flexibility. I've poked into it a couple of times but never in sufficient depth to see if we can even use it in our environment, let alone find out if it can do tricks like _bail_etc.

@Luap99
Copy link
Member

Luap99 commented May 6, 2024

Can you find a way to implement that in YAML?

I have not looked deeply into it but for _bail_if_test_can_be_skipped and system tests
only_if: changesInclude('test/system/**') || !changesIncludeOnly('test/**','docs/**')

Unless I am missing some conditional this does not look to complex to me

@edsantiago
Copy link
Member Author

That's a good first approximation but it neglects the fact that most (all?) xxx_task rules already have an existing only_if that would have to be considered. Plus the tag thing, and the branch thing, and the cron thing (other different ways of running CI). It's possible, even likely that I'm mistaken in using the word "impossible"; it's just something that has been too daunting for me.

@TomSweeneyRedHat
Copy link
Member

LGTM

@Luap99
Copy link
Member

Luap99 commented May 7, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 7, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit bcc7537 into containers:main May 7, 2024
91 checks passed
@edsantiago edsantiago deleted the skip-machine-tests-if-we-can branch May 8, 2024 00:56
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Aug 7, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Aug 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants