-
Notifications
You must be signed in to change notification settings - Fork 173
Add CI workflow for flaky runs #2618
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
Merged
+62
−1
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -126,6 +126,66 @@ jobs: | |
| with: | ||
| name: Unittest report ${{ matrix.os }}-${{ matrix.pixi-environment }} | ||
| path: ${{ env.COVERAGE_REPORT }} | ||
| flaky-unit-test: | ||
| name: "Flaky unit tests: ${{ matrix.os }} | pixi run -e ${{ matrix.pixi-environment }} tests -m 'flaky'" | ||
| runs-on: ${{ matrix.os }}-latest | ||
| needs: [cache-pixi-lock] | ||
| permissions: | ||
| contents: read | ||
| env: | ||
| COVERAGE_REPORT: "${{ matrix.os }}_${{ matrix.pixi-environment }}_unit_test_report.html" | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu] | ||
| pixi-environment: [test] | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Restore cached pixi lockfile | ||
| uses: Parcels-code/pixi-lock/restore@38495788b79a5ff26009aecc15daa9a8310b8832 # v0.1.0 | ||
| with: | ||
| cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} | ||
| - uses: prefix-dev/setup-pixi@fef5c9568ca6c4ff7707bf840ab0692ba3f08293 # v0.9.0 | ||
| with: | ||
| pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }} | ||
| locked: false # TODO: Remove once v7 of the lock file is removed, or once we stop having external source dependencies https://github.com/Parcels-code/Parcels/pull/2550#issuecomment-4088660238 | ||
| cache: true | ||
| cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | ||
| # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache | ||
| - name: Restore cached hypothesis directory | ||
| id: restore-hypothesis-cache | ||
| uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | ||
| with: | ||
| path: .hypothesis/ | ||
| key: cache-hypothesis-${{ runner.os }}-${{ github.run_id }} | ||
| restore-keys: | | ||
| cache-hypothesis-${{ runner.os }}- | ||
| - name: Unit test | ||
| id: unit-test | ||
| run: | | ||
| pixi run -e ${{ matrix.pixi-environment }} tests -m 'flaky' -v -s --cov=parcels --cov-report=xml --html="${COVERAGE_REPORT}" --self-contained-html | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is basically equivalent to |
||
| # explicitly save the cache so it gets updated, also do this even if it fails. | ||
| - name: Save cached hypothesis directory | ||
| id: save-hypothesis-cache | ||
| if: always() && steps.unit-test.outcome != 'skipped' | ||
| uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | ||
| with: | ||
| path: .hypothesis/ | ||
| key: cache-hypothesis-${{ runner.os }}-${{ github.run_id }} | ||
| - name: Codecov | ||
| uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 | ||
| env: | ||
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # zizmor: ignore[secrets-outside-env] | ||
| with: | ||
| flags: unit-tests | ||
| - name: Upload test results | ||
| if: ${{ always() }} # Always run this step, even if tests fail | ||
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | ||
| with: | ||
| name: Flaky unittest report ${{ matrix.os }}-${{ matrix.pixi-environment }} | ||
| path: ${{ env.COVERAGE_REPORT }} | ||
| integration-test: | ||
| name: "Integration: ${{ matrix.os }} | pixi run -e ${{ matrix.pixi-environment }} tests-notebooks" | ||
| runs-on: ${{ matrix.os }}-latest | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 workflow is mostly the same as the unit test one. I kept in the coverage and the test reporting (in case we mark more tests as flaky in future, it would be handy to have coverage and this output I think )