Repository navigation
ci(bench): run every benchmark harness module in the CI Gate (#1679) - #1681
Conversation
test_measurement_tools imported pytest, which the benchmark project's locked environment does not provide, so it could not run beside the other harness modules. Express the same 16 cases as unittest subtests. Close stdin for every tool invocation: the stub sudo reads stdin, and the fio case hung whenever the runner inherited an open one. pytest had been masking that by closing stdin itself. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
#1628 moved g500-ladder-qualification.schema.json from docs/ into benchmarks/schemas/, beside its only validator. Every other document there carries a top-level graphforge-*-schema/N identity, and discover_fixtures requires one, so the benchmark smoke and test_smoke have failed since the move. Nothing ran them. Add the identity rather than relax the rule; JSON Schema 2020-12 treats the extra keyword as an annotation, so validation is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Only eight of the 41 benchmarks/tests modules ran in CI, from an explicit list in the Rust Tests job. Make benchmarks/tests a package and run the whole tree with unittest discovery in a Benchmark Harness Tests job, so a new module runs without being wired anywhere. The GDC suites build Rust runners against graphforge-api, so the job follows the Rust test gate. It runs beside Rust Tests instead of lengthening the CI Gate's critical path. The CI storage policy now requires that lane to run discovery from benchmarks/, follow the Rust test gate, and feed CI Gate, and it requires every test_*.py to be reachable through packages. Negative fixtures cover each of these. The benchmark smoke target uses the same package discovery, which stops loading modules twice under two names. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Harness, test and schema edits under benchmarks/ enable rust_tests, which the Benchmark Harness Tests lane follows. Now that benchmarks/tests is a package, ruff sorts its imports as first-party, so regroup them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: CurateLabs/graphforge/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This comment has been minimized.
This comment has been minimized.
…1679) test_progressive_host_run defaulted its scratch parent to /home/ubuntu/graphforge-ladder-test, a path on one development host. On a CI runner, setUpModule and 13 native ladder controller tests failed with PermissionError the first time the suite ran there. Default to a directory under the temporary root instead. scripts/test_environment.py checks that root is native storage and exports it in CI. GF_LADDER_TEST_ROOT still overrides, and the retained evidence root stays untouched. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ch root (#1679) test_native_ladder_controller imported WORK_PARENT from test_progressive_host_run but not the setUpModule that creates it, so it passed only when that module ran first or a previous run had left the directory behind. Discovery runs it first, and on a fresh CI runner 13 tests failed with FileNotFoundError. Share both module fixtures, which also extends the top-level leak check to this module. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Closes #1679
What changes
All 41
benchmarks/testsmodules now run in the CI Gate. Before this PR, 8 ran, from an explicit list in Rust Tests.benchmarks/testsis now a package, and a new Benchmark Harness Tests job runsunittest discover -v -s tests -t . -p 'test_*.py'frombenchmarks/. A new module runs without being wired anywhere.rust_tests, because the four GDC suites build Rust runners againstgraphforge-api.benchmarks/path exceptbenchmarks/algorithms/already falls through the classifier toenable_all, and no harness module readsbenchmarks/algorithms/. New classifier assertions pin this for test, harness and schema edits.Policy (
scripts/ci/test-ci-storage-policy.py) requires four things, and negative fixtures cover each one:benchmarks/, and it runs the exact discovery command, not a module list;rust_tests;test_*.pyunderbenchmarks/testscan be reached through packages.The dependency-cache inventory moves from 11 to 12 for the new job's registry cache.
test_smoke:test_checked_in_fixtures_are_discoverablefailed ong500-ladder-qualification.schema.json. docs: move evidence out of the tree, prune orphan dev docs, give ADRs a lifecycle (#1625) #1628 moved that schema fromdocs/intobenchmarks/schemas/, next to its only validator (progressive_storage_qualification.py). The move itself was right, and moving the file back would break docs: stop committing per-issue evidence to the docs tree, prune unreferenced development docs, and give ADRs a lifecycle #1625's docs-tree rule. Every other document inbenchmarks/schemas/has a top-levelgraphforge-*-schema/Nidentity, anddiscover_fixturesrequires one, so this PR adds"schema": "graphforge-g500-ladder-qualification-schema/4". JSON Schema 2020-12 treats an unknown keyword as an annotation, so validation doesn't change, andtest_progressive_storage_qualificationandtest_native_ladder_controllerstill pass.make -C benchmarks smokefailed for the same reason and now passes.test_measurement_tools: this was the only pytest module in a unittest-only locked environment. It is rewritten as unittest subtests covering the same 16 cases, with no new dependency. The conversion exposed a second bug that pytest had been masking. The stubsudorunscat >/dev/null, andrun-f1.shcalls it without redirecting stdin, so the fio case hung whenever the process inherited an open stdin. Every tool invocation now passesstdin=subprocess.DEVNULL.make -C benchmarks smoke-pythonnow uses the same package discovery. Its old-s testsform loaded modules twice, astest_xand astests.test_x.Evidence
Exact CI command, run from a fresh worktree with no
benchmarks/target,CARGO_BUILD_JOBS=4, ext4TMPDIR:PYTHONPATH=harness uv run --locked python -m unittest discover -v -s tests -t . -p 'test_*.py'Result:
Ran 528 tests in 263.539s,OK, 41 modules, 0 skipped. The 528 is the issue's 453, plus 69 fromtest_tck_perf(#1680), 1 new intest_benchexec_authority, and 5 more fromtest_measurement_tools(6 methods instead of 1 import error). The per-module sum matches the discovery total, so nothing is loaded twice.Mutations:
benchmarks/tests/test_zz_mutation_probe.pywith a failing test was discovered:Ran 529,FAILED (failures=1), rc=1;benchmarks/tests/probe/test_probe.pyin a directory without__init__.pyfails the policy;tests/__init__.pyfails both the policy and discovery;run-perf.shfails all 6test_measurement_toolswatchdog subtests.Gates:
make pre-push-fast,python3 scripts/ci/test-ci-storage-policy.py,bash scripts/ci/test-classify-changes.sh,make gate-registry-check,scripts/check-workflows.sh,bash scripts/ci/test-require-gates.sh,python3 scripts/ci/benchmark-measurement-policy.pyandpython3 scripts/ci/test-benchmark-measurement-policy.pyall pass.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.