Repository navigation
ci: run five-minute Rust chaos checks on affected PRs #4677
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
Open
Open
Changes from all commits
Commits
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| name: "Test: Rust chaos" | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| runner: | ||
| description: The GitHub-hosted runner label from .github/ci-suites.yml. | ||
| type: string | ||
| required: true | ||
| secrets: | ||
| CACHIX_PR_AUTH_TOKEN: | ||
| required: false | ||
| permissions: | ||
| contents: read | ||
| env: | ||
| NIX_DEVSHELL: rust | ||
| jobs: | ||
| test: | ||
| name: Five-minute fault run | ||
| runs-on: ${{ inputs.runner }} | ||
| # Includes the source builds and baseline before the five-minute fault run. | ||
| timeout-minutes: 60 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 | ||
| - name: Set up Nix | ||
| uses: ./.github/actions/setup-nix | ||
| with: | ||
| cache-mode: "ci" | ||
| cachix-pr-auth-token: ${{ secrets.CACHIX_PR_AUTH_TOKEN }} | ||
| github-token: ${{ github.token }} | ||
| - name: Build the chaos supervisor | ||
| run: dev/nix-shell 'just chaos build' | ||
| - name: Start the local backend and fault proxy | ||
| run: dev/nix-shell 'just backend up anvil toxiproxy' | ||
| - name: Test the chaos suite | ||
| run: dev/nix-shell 'just chaos test' | ||
| - name: Run the 50-round baseline | ||
| id: baseline | ||
| run: dev/nix-shell 'just chaos baseline --rounds 50 --seed 1338 --directory .chaos/ci-baseline' | ||
| - name: Run five minutes with all fault types enabled | ||
| # Timed runs finish their current round before checking the deadline. | ||
| run: dev/nix-shell 'just chaos run --hours 0.08333333333333333 --seed 1340 --faults all --directory .chaos/ci-faults' | ||
| - name: Report bounded run evidence | ||
| if: ${{ always() && steps.baseline.outcome != 'skipped' }} | ||
| run: | | ||
| for phase in baseline faults; do | ||
| directory=".chaos/ci-$phase" | ||
| if [ -d "$directory" ]; then | ||
| dev/nix-shell "just chaos status --directory $directory" | ||
| dev/nix-shell "just chaos inspect $directory" | ||
| fi | ||
| done | tee "$RUNNER_TEMP/chaos-report.txt" | ||
| # Raw .chaos files contain wallets and database keys. Upload only the | ||
| # bounded status/inspect output, including on a failed or inconclusive run. | ||
| - name: Retain the bounded chaos report | ||
| if: always() | ||
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 | ||
| with: | ||
| name: chaos-report | ||
| path: ${{ runner.temp }}/chaos-report.txt | ||
| if-no-files-found: ignore | ||
| retention-days: 7 | ||
| - name: Retain backend startup diagnostics | ||
| if: failure() | ||
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 | ||
| with: | ||
| name: chaos-backend-startup-logs | ||
| path: ${{ runner.temp }}/backend-startup-logs | ||
| if-no-files-found: ignore | ||
| retention-days: 7 | ||
| - name: Stop the local backend | ||
| if: always() | ||
| run: dev/nix-shell 'just backend down' |
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.
The README's later statement under Results still says the suite is outside CI, contradicting this new section and potentially misleading contributors about the blocking check. Please remove “and CI” there.
Suggested fix:
Posted via Macroscope — Code Quality