-
-
Notifications
You must be signed in to change notification settings - Fork 129
ci(test): committed gap-suite runner + informational smoke-parity gate #5222
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
TheHypnoo
wants to merge
7
commits into
main
Choose a base branch
from
chore/ci-smoke-parity-gate
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+129
−1
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4262e2e
ci(test): committed gap-suite runner + informational smoke-parity gate
TheHypnoo 5a309ab
Merge branch 'main' into chore/ci-smoke-parity-gate
TheHypnoo d9bc1db
Merge branch 'main' into chore/ci-smoke-parity-gate
TheHypnoo 101ce8d
ci(test): scope gap-runner temp files to a mktemp dir (CodeRabbit)
TheHypnoo a05a39e
Merge branch 'main' into chore/ci-smoke-parity-gate
TheHypnoo 1635607
Merge branch 'main' into chore/ci-smoke-parity-gate
TheHypnoo 6d5a488
ci(smoke-parity): run the gap suite under node 22 + persist-credentia…
TheHypnoo 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| #!/usr/bin/env bash | ||
| # Committed runner for the Perry "gap" suite. | ||
| # | ||
| # Every test-files/test_gap_*.ts is AOT-compiled by Perry and diffed | ||
| # byte-for-byte against `node --experimental-strip-types`. This is a thin | ||
| # wrapper over run_parity_tests.sh --filter test_gap_ so it reuses the ONE | ||
| # canonical normalizer, the skip-list, the per-test output cap, and the JSON | ||
| # report (this shared-normalizer reuse is the seed of roadmap initiative I-14). | ||
| # | ||
| # Replaces the out-of-repo /tmp/run_gap_tests.sh that CLAUDE.md used to point | ||
| # at — the gap suite is the highest-signal-per-second test Perry has and was | ||
| # previously dark in CI. | ||
| # | ||
| # Regression-gate semantics: exits non-zero if any gap test fails parity or | ||
| # compilation and is NOT already triaged in test-parity/known_failures.json. | ||
| # (run_parity_tests.sh's own exit code only trips below 80% AGGREGATE parity, | ||
| # which is far too loose to catch a single-feature regression — exactly the | ||
| # "a module silently went to 0 behind a green build" class.) | ||
| # | ||
| # Requirements: | ||
| # - a Rust toolchain (the wrapped run_parity_tests.sh builds target/release/perry) | ||
| # - node with --experimental-strip-types | ||
| # - jq | ||
| # | ||
| # Usage: scripts/run_gap_tests.sh | ||
| set -euo pipefail | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" | ||
| cd "$ROOT" | ||
|
|
||
| # Run-scoped temp dir — fixed /tmp names would let concurrent runs (a second | ||
| # PR, local + CI on the same box, or the future node-suite-guard alongside) | ||
| # clobber each other's failure lists and produce a false gate result. | ||
| WORK="$(mktemp -d "${TMPDIR:-/tmp}/perry-gap.XXXXXX")" | ||
| trap 'rm -rf "$WORK"' EXIT | ||
|
|
||
| echo "==> Running gap suite (test-files/test_gap_*.ts) via run_parity_tests.sh --filter test_gap_" | ||
| # run_parity_tests.sh exits 1 when AGGREGATE parity < 80%. We gate on "no NEW | ||
| # untriaged failures" instead (below), so don't let its aggregate exit abort us. | ||
| set +e | ||
| ./run_parity_tests.sh --filter test_gap_ | ||
| set -e | ||
|
|
||
| REPORT="test-parity/reports/latest.json" | ||
| KNOWN="test-parity/known_failures.json" | ||
| if [[ ! -f "$REPORT" ]]; then | ||
| echo "ERROR: parity report not found at $REPORT (did run_parity_tests.sh run?)" >&2 | ||
| exit 2 | ||
| fi | ||
|
|
||
| # Every failure in this report is a gap test (we filtered on test_gap_), so the | ||
| # whole failure set is the gap failure set. Drop empty entries (run_parity_tests.sh | ||
| # emits compile: [""] when there are zero compile failures). | ||
| jq -r '(.failures.parity // []) + (.failures.compile // []) | .[] | select(. != "")' \ | ||
| "$REPORT" | sort -u > "$WORK/all_fails.txt" | ||
|
|
||
| if [[ -f "$KNOWN" ]]; then | ||
| # known_failures.json is keyed by test name; skip the audit-metadata _schema key. | ||
| jq -r 'keys[] | select(. != "_schema")' "$KNOWN" | sort -u > "$WORK/known.txt" | ||
| else | ||
| : > "$WORK/known.txt" | ||
| fi | ||
|
|
||
| comm -23 "$WORK/all_fails.txt" "$WORK/known.txt" > "$WORK/new.txt" | ||
| TOTAL=$(wc -l < "$WORK/all_fails.txt" | tr -d ' ') | ||
|
|
||
| if [[ -s "$WORK/new.txt" ]]; then | ||
| echo "" >&2 | ||
| echo "NEW gap failures (not triaged in test-parity/known_failures.json):" >&2 | ||
| sed 's/^/ - /' "$WORK/new.txt" >&2 | ||
| echo "" >&2 | ||
| echo "Fix the regression, or — if the failure is intentional/known — add a" >&2 | ||
| echo "triaged entry to test-parity/known_failures.json (category + reason)." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "All ${TOTAL} gap failures (if any) are known/triaged. Gap gate OK." |
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.
🧩 Analysis chain
🏁 Script executed:
Repository: PerryTS/perry
Length of output: 4338
🏁 Script executed:
Repository: PerryTS/perry
Length of output: 1241
Pin all GitHub Actions in the
smoke-parityjob to commit SHAs.Four actions use mutable version tags instead of commit SHAs:
actions/checkout@v6(line 284)dtolnay/rust-toolchain@stable(line 289)Swatinem/rust-cache@v2(line 291)actions/setup-node@v6(line 294)Pinning to full commit SHAs is required to prevent supply-chain drift and ensure policy compliance.
🧰 Tools
🪛 zizmor (1.25.2)
[warning] 284-284: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[error] 284-284: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[error] 287-287: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[error] 289-289: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[error] 295-295: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[error] 289-289: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default
(cache-poisoning)
[error] 295-295: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default
(cache-poisoning)
🤖 Prompt for AI Agents
Source: Linters/SAST tools