Repository navigation
Add regression testing of the examples against main (#1731) - #1733
Conversation
- examples/run_examples_regression.py runs all *-test.cfg examples (skipping MPI, batch and follow-up configurations), checks that each run completed without errors, and compares outputs and CAPRI statistics with a reference built from origin/main in a separate git worktree. Writes a report of the differences, including the rank of the first acceptable model and the rank and quality of the best model. - Removed run_tests.py, compare_runs.py and run_examples-full.py, and the test that kept the first two in sync. - Added the extract-capri-stats-*.sh scripts and described them in examples/README.md. - Rewrote docs/pages/testing/integration_tests.md for the new workflow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gression-tests-1731
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comp-era
left a comment
There was a problem hiding this comment.
When init --only is used, the new results are merged into the existing reference.json, but the top-level commit field is overwritten without checking whether the previous results came from the same commit.
Since each init fetches the latest origin/main, rerunning only a subset of tests after main has advanced can produce a reference containing results from different commits, while the report identifies only the latest commit. The same applies to current.json if the branch gets new commits between run --only calls.
Could we add a check that compares the current commit with the one stored in the JSON file before running the tests? If they differ, the script could require a full reference rebuild or allow the user to specify the previous commit using --ref-branch. Alternatively, storing the commit for each test would allow the report to identify mixed reference results.
Results merged with --only now keep the commit of each test. Merging with saved results from another commit stops unless --allow-mixed is given, and the report header lists tests from other commits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @Comp-era, good catch. Addressed in 374cdf6 with a combination of both suggestions:
Older result files without per-test commits fall back to the file's commit. A test covers the check, the override and the report header, and the docs describe the new behaviour. |
Comp-era
left a comment
There was a problem hiding this comment.
I pulled the latest changes and verified the fix. All tests passed, and the commit-consistency check correctly prevents partial runs from mixing results from different commits.
Looks good from my side.
What does this PR do and why?
This PR adds
examples/run_examples_regression.py, which replaces the manual run-and-compare procedure for the integration tests. It runs allexamples/*/*-test.cfgfiles on the current code and compares the results with a reference built fromorigin/main.initbuilds it in a separate git worktree, so the developer's checkout is not touched.--extend-run,--restart). 55 tests are run.Finished atand contain noERRORlines, and every module must have its step folder. The number of output models and the files written by each step are compared with the reference. This also covers the scoring and analysis examples that have no caprieval step.examples/regression/report.mdlists new failures, output differences, quality and ranking changes with better/worse markers, runtime changes, and skipped tests.Housekeeping:
run_tests.py,compare_runs.pyandrun_examples-full.py, and the test that kept the first two in sync. The two scripts used a hard-coded list of 30 tests.extract-capri-stats-*.shscripts, which summarise a single run.examples/README.mdanddocs/pages/testing/integration_tests.mdfor the new workflow.How was this tested?
tests/test_examples_regression.pycovers test selection and skips, CAPRI statistics (DockQ and ligand criteria), the completion check, and the comparison (changes, new failures, failures on both sides).extract-capri-stats-dockq.shandextract-capri-stats-ligand.shon existing runs; the values are identical.init+run(55 tests each) comparingmainwith thecns-scripts-consistencybranch. All tests ran, and the report flagged the expected differences in the CG examples.AI assistance
Claude Code wrote the script, the tests and the documentation updates based on my specifications and checked them as described above. I reviewed the changes and ran the full regression set myself.
Checklist
docs/andexamples/README.md; no user-manual change needed)CHANGELOG.mdupdated for user-facing changesRelated issues
Closes #1731
Notes for reviewers
--listshows which).🤖 Generated with Claude Code