ci: run plugin Python test suites (catches the PR #125 regression)#147
Merged
ci: run plugin Python test suites (catches the PR #125 regression)#147
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
Discovers test_*.py / *_test.py files under plugins/ and executes each one as a script. Matches the style of the existing bats job. Works today for: - plugins/constant-time-analysis/ct_analyzer/tests/test_analyzer.py - plugins/let-fate-decide/.../scripts/test_draw_cards.py Both test files already exist in the repo but no CI job invoked them. As a result, PR #125 (which broke let-fate-decide by removing `import os` while leaving `os.path` calls in draw()) merged with green CI even though the existing `test_draw_*` / `test_cli_*` tests would have caught it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nalysis TestCrossArchitecture.test_cross_compile_arm64 invokes clang with --target=aarch64-unknown-linux-gnu, which needs the aarch64 libc headers. Without them clang fails with: fatal error: 'bits/libc-header-start.h' file not found Install gcc-aarch64-linux-gnu + libc6-dev-arm64-cross so clang can find the cross headers. Also install clang explicitly since the runner may not have it preinstalled. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
59a4b5e to
f37d54e
Compare
Resolves code review findings on PR #147 (comment accuracy only — no behavior change): - Rewrite the toolchain dependencies comment. The previous wording ("aarch64 cross gcc pulls in libc6-dev-arm64-cross") implied a transitive dependency, but `--no-install-recommends` suppresses Recommends, so libc6-dev-arm64-cross is installed only because it is listed explicitly. New comment names what each package supplies. - Document why `set -uo pipefail` deliberately omits -e (the loop collects per-file failures and exits with a combined code). Reviewers (codex + gemini + pr-review-toolkit agents) flagged 13 findings total; 11 were dismissed (false positives, design choices matching the bats job, or speculative). Quality pipeline (actionlint, zizmor, shellcheck, pre-commit, plugin validators, both Python test suites) all pass locally. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Member
Review SummaryThree review passes ran in parallel against the head commit ( Findings
Codex returned 0 findings. Verification
Commit
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a
python-testsjob tolint.yml, parallel to the existingbatsjob. Discoverstest_*.py/*_test.pyunderplugins/and runs each as a script. Currently exercises:plugins/constant-time-analysis/ct_analyzer/tests/test_analyzer.py(unittest, 60 tests)plugins/let-fate-decide/skills/let-fate-decide/scripts/test_draw_cards.py(stdlib self-runner, 27 tests)Both test files already existed; no CI job invoked them.
Motivation
PR #125 ("replace os.urandom with secrets.randbelow") removed
import osbut leftos.pathcalls insidedraw(). Ruff F821 catches this today, but the check went green at merge time (the PR's head commit was pushed 12 days before merge and wasn't re-run against drifted main). The existingtest_draw_*/test_cli_*tests intest_draw_cards.pywould also have caught it —draw()raisesNameErroron every call — but no CI job ran them. PR #144 fixes the one-line import.A Python-tests CI job would have caught the regression independently of ruff.
Expected CI behavior on this PR
The
python-testsjob will FAIL on this PR until #144 merges. That failure is the point — it demonstrates the regression. Once #144 lands on main, rebase this PR and the job goes green. Suggested merge order:import osfix)Or merge both together; either way the end state is green.
Design notes
python3 path/to/test.py) rather than invokingpytest. Matches how the existing tests are authored (each has anif __name__ == '__main__':main block or usesunittest's auto-discovery), avoids pytest rootdir/conftest surprises, and keeps the job dependency-free.finddiscovery means new plugin test files are picked up automatically — no per-plugin config.::group::folding so each test file's output is collapsed in the Actions UI.Test plan
let-fate-decide-fix)test_draw_cards.pyfails on currentmain(the let-fate-decide: replace os.urandom with secrets.randbelow #125 bug),test_analyzer.pypasses