-
Notifications
You must be signed in to change notification settings - Fork 184
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
chore(ci): Set up a separate workflow for flaky tests #1922
Conversation
This sets up a separate workflow which runs all tests, including flaky ones. It can be triggered by setting the "flaky" label on a PR, which will disable the normal CI workflow as well. It can also be manually triggered on a branch.
They are on hosted runners anyway
@Arqu could you have an initial look at this and point out all silly things I did the hard way? I think this is remarkably close already. If you have any ideas on notifications for the cron job I'd be happy as well. |
Since the tests run in the flaky workflow are so similar to the tests in normal CI, maybe we should check if this is doable with a reusable-workflow instead? It could take inputs for the few differences (if conditions and test args). |
I rather like this But now it opens the door to only having a single Upsides:
Downsides:
|
if only americans could spell labelled. Without this when you remove the flaky-test label your PR is stuck in a weird state until you push something again. I think not having that confusion trumps cancelling jobs on labelling changes. Also, I don't think we currently label PRs?
Will take a look tonight. |
@@ -0,0 +1,182 @@ | |||
# Run all tests, with or without flaky tests. | |||
|
|||
name: Tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice.
esac | ||
|
||
- name: check features | ||
if: ${{ ! inputs.flaky }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is inputs.xyz
the correct syntax here. Afaik these should be subclassed to github.event.inputs
or github.inputs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i believe inputs
is correct: https://docs.github.com/en/actions/learn-github-actions/contexts#inputs-context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I used to think it was always scoped to the github
context.
.github/workflows/ci.yml
Outdated
env: | ||
RUST_LOG: "TRACE" | ||
tests: | ||
if: "! contains(github.event.pull_request.labels.*.name, 'flaky-test')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will fail outside of a PR context as the github.event.pull_request
object will be null
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made it so they always run outside of PR context
.github/workflows/ci.yml
Outdated
@@ -2,6 +2,7 @@ name: CI | |||
|
|||
on: | |||
pull_request: | |||
types: [ 'labeled', 'opened', 'synchronize', 'reopened' ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice idea to use labels to control flow. We could do a no-netsim
flag to skip netsim for in progress PRs later.
@Arqu PTAL, thanks for the suggestions |
LGTM now. I guess we need to rebase this and then align branch protections. |
@Arqu merged master (and fixed another bug...) should be good to merge and adjust the branch protections |
I've also made /~https://github.com/n0-computer/iroh/wiki/Flaky-Tests as a reference for how this is to be used. |
## Description This sets up a separate workflow which runs all tests, including flaky ones. It can be triggered by setting the "flaky-test" label on a PR, which will disable most of the normal CI workflow and instead run just the tests including flaky ones. The flaky workflow can also be manually triggered on a specific branch. ## Notes & open questions - The flaky workflow only runs the tests, none of the other jobs. - Cross-compiled jobs aren't even included. Maybe they should be but right now they don't run tests at all so is pointless. - On any labelling change for the PR the jobs in the workflows will be cancelled if they're still running. I don't think we generally label PRs so that's probably fine. - Flaky tests are going to be carnage for a while! - We have no notification for the cron job results yet. Not sure how to approach this. I'd be fine doing this later. - The `workflow_dispatch` version (aka manual trigger) is untested, I think we have to wait until it is merged to main to be able to test that? - The UI will now always show all jobs: the skipped flaky jobs on normal PRs and the missing normal jobs on flaky PRs. That's probably fine? A bit noisier though. - The set of "required jobs" has changed again and will need patching up in branch protection. This implements the bulk of n0-computer#1919 ## Change checklist - [x] Self-review. - [x] Documentation updates if relevant. - [x] Tests if relevant. --------- Co-authored-by: Asmir Avdicevic <asmir.avdicevic64@gmail.com>
## Description This sets up a separate workflow which runs all tests, including flaky ones. It can be triggered by setting the "flaky-test" label on a PR, which will disable most of the normal CI workflow and instead run just the tests including flaky ones. The flaky workflow can also be manually triggered on a specific branch. ## Notes & open questions - The flaky workflow only runs the tests, none of the other jobs. - Cross-compiled jobs aren't even included. Maybe they should be but right now they don't run tests at all so is pointless. - On any labelling change for the PR the jobs in the workflows will be cancelled if they're still running. I don't think we generally label PRs so that's probably fine. - Flaky tests are going to be carnage for a while! - We have no notification for the cron job results yet. Not sure how to approach this. I'd be fine doing this later. - The `workflow_dispatch` version (aka manual trigger) is untested, I think we have to wait until it is merged to main to be able to test that? - The UI will now always show all jobs: the skipped flaky jobs on normal PRs and the missing normal jobs on flaky PRs. That's probably fine? A bit noisier though. - The set of "required jobs" has changed again and will need patching up in branch protection. This implements the bulk of #1919 ## Change checklist - [x] Self-review. - [x] Documentation updates if relevant. - [x] Tests if relevant. --------- Co-authored-by: Asmir Avdicevic <asmir.avdicevic64@gmail.com>
Description
This sets up a separate workflow which runs all tests, including flaky ones. It can be triggered by setting the "flaky-test" label on a PR, which will disable most of the normal CI workflow and instead run just the tests including flaky ones.
The flaky workflow can also be manually triggered on a specific branch.
Notes & open questions
workflow_dispatch
version (aka manual trigger) is untested, I think we have to wait until it is merged to main to be able to test that?This implements the bulk of #1919
Change checklist