Repository navigation
test: run tests in parallel, split CI static checks, trim slow tests and fold golden snapshots - #358
Merged
Merged
Conversation
Each baseline now records a digest of every normalized report route next to its outline, and further report scenarios of a track keep their route digests in tests/baselines. One refresh command (WEBSTONE_UPDATE_BASELINES=1) replaces UPDATE_GOLDEN, and the duplicate golden builds of scenarios the baselines already render are gone. The ASCII-locale build check replays the baselines.
Catalog-mutation tests checked one changed field each but re-read every frozen task file. A shared fixture serves the registered suites' validation from one computed result; unregistered suites still validate in full.
The full-capture replay of the shipped SimpleQA reference dataset took about three minutes; synthetic replay tests in test_simpleqa.py cover its rules.
Damage cases that one validator rejects regardless of mode now run on one mode while every mode keeps its clean build; built reports are copied per test instead of rebuilt; local fixture servers poll shutdown every 10 ms.
Matrices whose cases reach the same validator keep one case per distinct branch; read-only tests share module-built inputs; oversized synthetic populations shrink where the counts are not production constants; a real retry interval sleep is patched out; duplicate Lexbench verify runs merge into the end-to-end edition test.
make test-python uses one worker per CPU (PYTEST_WORKERS, 0 for serial). Static checks, the fixture smoke test and the Node and extraction SDK suites move into their own CI job through make ci-static, so every pytest shard runs only pytest; pytest runs on three shards instead of two.
Tests marked node_packages skip with a clear reason on a checkout without node_modules; CI (CI set) still runs and requires them.
The suite-consistency assertions join the catalog release test, and the installed-metadata test checks only the Web Search catalog, so one worker validates the frozen Web Fetch task files instead of three.
lanyue-llk
force-pushed
the
refactor/test-speed
branch
from
November 24, 2026 10:46
b13ef0e to
7a8265a
Compare
This was referenced Nov 24, 2026
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.
Purpose
First pass at #356: tests run in parallel by default, every CI pytest shard runs only pytest, and the slowest tests run on smaller inputs. It also folds the golden byte snapshots into the per-track baselines (#352) and skips Node-package tests on a local checkout that has no
node_modules(#355).This PR does not reach the raised targets: under 60 s locally and under 3 min in CI. "Remaining work" below lists what is left, with numbers.
flowchart LR scope[Select check scope] --> static["Static checks and Node suites<br/>make ci-static: naming, lint, shell,<br/>fixture smoke, Node UI/adapters, extraction SDK"] scope --> s1["Python tests 1/3"] & s2["Python tests 2/3"] & s3["Python tests 3/3"] scope --> pkg[Installation and packaging] & browser[Rendered reference and report checks] static & s1 & s2 & s3 & pkg & browser --> gate["Python 3.11 (required)"] subgraph baselines["tests/baselines (one refresh: WEBSTONE_UPDATE_BASELINES=1)"] stage["per-track stage snapshot<br/>records + outline + route digests"] variants["further report scenarios<br/>route digests only"] endWhat changed
make test-pythonpasses-n $(PYTEST_WORKERS) --dist worksteal.PYTEST_WORKERSdefaults toauto, andPYTEST_WORKERS=0runs serially. The newmake ci-staticruns naming, lint, shell, fixture smoke, Node UI/adapter tests and the extraction SDK tests.make ci-testsis nowci-static+test-python. In CI, that work moves to its ownstaticjob, which also runsdocs-checkfor documentation-only PRs, and pytest runs as three shards of-n 4instead of two. The requiredPython 3.11gate now needsstatic. CONTRIBUTING and.github/workflows/README.mddescribe the new layout.tests/golden/,tests/golden_snapshots.pyandtests/test_golden_reports.pyare removed. Each baselineroutesentry is now"<route> <sha256-prefix>"over normalized bytes, and the unpinned-Mermaid guard moved with it. The checkout path is normalized to<checkout>. Golden scenarios that the stage baselines did not already render keep route-digest baselines intests/baselines/: browser-use pass; trajectory-replay pass and step-durations; the three curated replay variants; public WebArena; lexbench macos and linux; wcxb; webmainbench sample and full.headless-engine-routes.jsonland its test moved totests/baselines/.UPDATE_GOLDENis replaced byWEBSTONE_UPDATE_BASELINES.node_packagesmarker skips a test with the reason "runnpm ci" whennode_modulesis absent andCIis unset, so CI still requires these tests. It is applied to 4 converter tests, the HTML-to-Markdown test, the headless converter test and 4 CI-concurrency tests.Baselines
The only content change is the format of
routes: a sorted list of names becomes a sorted list ofname digestlines. I checked that the route names are identical before and after in every existing baseline. Two digest values differ from the deleted golden files:wcxbandwebmainbench-samplepick up #351'sreproducepage change, which updated the golden files on main. The golden suite passed on main before the fold.Deleted, merged or shrunk tests
test_golden_reports.py(17 cases): web-fetch, web-search, browser-use fail, trajectory-replay fail, lexbench minimaltest_golden_reports.py: other scenariosweb_search/test_native_revisions.py::test_locked_reference_extensions_rescore…: full-capture replay of the shipped SimpleQA dataset (≈170 s serial)benchmarks/websearch/test_simpleqa.pycovers the replay accept/reject rules on synthetic capturestest_release_versions.py(8 tests),test_benchmark.py::test_all_shipped_suites_are_consistent,test_release_metadata.py(Web Fetch half): each re-validated every frozen suitevalidated_catalogfixture validates once per process; the suite-consistency assertions moved intotest_catalog_retains_registered_task_suites…; unregistered suites still validate in fulltest_explicit_utf8_io.py::test_lexbench_report_builds_under_an_ascii_locale[macos, linux][minimal], plus the ASCII replay of every stage baselinetest_ci_gate.py::test_only_documentation_uses_one_test_partitiontest_cohort_reportbound_intro…24→14,unknown_total_cost…45→17report_suitesummary_links4→1,authored_intro_links[False]repair_reviewmanaged_snapshot_repair28→10record_reportintro tests 12→7;execution_boundariesnative_redirect15→7;model_scoringtransport_recovery12→6;worker_resourcesrelease_boundary12→6;execution_settings9→3;completion_metrics20→10test_local_auditlocal matrix 6→3test_webmainbench_assembly[count=0,1,3]→[0,2]test_saved_matrix_evidence274→262,_revision56→45,_comparability98→82,_composition111→109test_lexbench_verification:complete_report_runs_all_evidence_negative_controls,three_configuration_report_passes…,chinese_only_report_passes…requested_editions…[True]asserts the full verify summary (372 cases, 4482 calls, 19 negative controls);[False]covers the zh-only report; stale-English rejection staystest_dual_content_scopesone_acquisition[zh][en]case builds both editionstest_external_local_report6→5 cases with smaller populationstest_selected_native_policy: real 6 smin_interval_secondssleeprunner.time.sleepis patchedtest_assemble_webfetch_refresh150→34 synthetic tasks,webmainbench_sample_case_correction5→3 methods,local_revisionchain built once per moduleMeasurements
-n 8)make test-python,-n auto)The scoring-source hash is unchanged (
0fe89317…).uv run --frozen lexbench-webfetch versionprints the same value.Remaining work for the raised targets (60 s local, 3 min CI)
test_fairnessfull reference ≈17 s,test_risk_control_datasetcontract check ≈13 s,test_popular_sites_current≈8 s,test_ground_truth≈6 s,test_scoring_regressions≈7 s,test_release_versionscatalog ≈9 s;test_moli_providerandtest_browser_observation_contracts, where real timeouts are the behaviour under test.Verification
make test-python: everything passes except one flakytest_moli_providerprocess-timeout subtest, which fails only under host load. That file is unchanged, a different moli timeout test also failed on main in the base run, and the test passes in CI.uv run --frozen --all-extras python -m pytest tests/baselines: 30 passed, stable across repeated runs.make lint-check: passed.node_modules: the marked tests skip with the reason, and withCI=1they fail as required.Breaking changes
UPDATE_GOLDEN=1andGOLDEN_KEEPare removed. UseWEBSTONE_UPDATE_BASELINES=1.make test-pythonis parallel by default. UsePYTEST_WORKERS=0to run serially.make ci-testsno longer runstest-uiandtest-native-adaptersthroughmake test. Both now run inside the newmake ci-static.Closes #352
Closes #355
Part of #356