Repository navigation
test(suite): share write_json, mark slow tests and move Rainbond tests - #237
Merged
Merged
Conversation
lanyue-llk
commented
Nov 4, 2026
lanyue-llk
left a comment
Contributor
Author
There was a problem hiding this comment.
Independent review, round 1
Head reviewed: 0573ae43. No defects found. No P0, P1, P2 or P3 findings.
What I verified
Helper swap
- I compared all removed
write_jsonand_write_jsoncopies withtests/helpers.py. The copies differed in three ways:ensure_ascii, the trailing newline, andindent=2intest_assemble_webfetch_refresh.py. The helper also addsmkdirwhere some copies had none. - No test depended on those bytes. The changed test modules passed, with the known local failures noted below, and
tests/test_golden_reports.pypassed without snapshot changes. - No references to the removed
self.write_jsonor_write_jsontest helpers remain.fixture['write_json']intests/package_smoke.pystill resolves through the fixture's module globals.
Over-design
- The obvious simpler form is the existing
harness.record_io.write_json. I tried it behind the helper in a scratch copy, and it is not a drop-in replacement. - Its indented output changes fixture hashes. With
parents=True, the WCXB and Lexbench golden report tests fail, as doestest_report_builds_are_byte_identical_under_an_ascii_locale. Withparents=False, many more tests fail. - The compact helper therefore preserves the snapshots. The Lexbench wrapper that returns a hash is one line and its callers use the digest.
tests/package_smoke.py
sys.path.appendruns after the "outside the checkout" assertion and places the checkout after site-packages. The repository root has noharnessdirectory because of thesrclayout.- No live code under
src/imports top-leveltestsorscripts. The only match is a frozen.py.txtdata file. - CI's "Installation and packaging" job runs
make package-check, and that job passed.
Behaviour test
test_local_audit_banner_has_no_pull_request_numberfails whenPR #30is injected into the banner.- It also fails when the English attribute is removed.
slow marker
-m slowcollects 19 tests, matching the PR description.make -n test-python PYTEST_ARGS='-m "not slow"'keeps the quoting intact.- CI passes no
-mexpression, so it still runs these tests.
Rainbond move
- Both files are pure renames with no path dependence on their old directory.
- The only
conftest.pyistests/conftest.py, so the move loses no fixtures. - The old test paths have no remaining references. The Makefile audit target still collects the slice tests.
- The Rainbond tests that stay in
public_webarenaexerciseWebArenaEnvironmentwiring and example templates, so leaving them there is reasonable.
Scope
- The issue's latest comment narrows it to the four items this PR delivers, so
Closes #105is accurate. - The PR touches no workflow files, evidence or profiles.
Test results (local)
- Both lint gate commands passed.
- Changed test modules plus
tests/test_golden_reports.py, excludingreal_smoke: 733 passed, 4 skipped, 2 failed. - Both failures are on the known local-failure list and neither is caused by this PR:
test_current_dataset_registry_and_profile_are_one_complete_matrixtest_zillow_full_score_requires_distinct_numeric_card_fields[3 beds · 2.5 baths · 1,200 sqft-True]
- I did not run the full suite locally or
tests/package_smoke.py. For those I rely on CI.
CI on the current head
All checks pass: "Tests and static checks", "Installation and packaging", "Rendered reference and report checks", "Python 3.11", "Select check scope", "OCR dispatch" and ocr-review.
lanyue-llk
added a commit
that referenced
this pull request
Nov 4, 2026
lanyue-llk
added a commit
that referenced
this pull request
Nov 4, 2026
lanyue-llk
force-pushed
the
test/tidy-suite-structure
branch
from
November 4, 2026 09:25
0573ae4 to
722408f
Compare
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.
Issues
Closes #105
The issue was narrowed in its latest comment to these four items; the private-import sweep is dropped.
Summary
tests/helpers.pyholds onewrite_json, replacing 15 copies. It creates the parent directory, writes UTF-8 JSON with a trailing newline, and returns the path. The Lexbench report fixture keeps a one-line wrapper that returns the file hash, because its callers bind that digest;test_lexbench_report_runtime.pynow imports that wrapper instead of its own copy.runpy, so those fixtures needtests.helpersto resolve.tests/package_smoke.pynow appends the checkout tosys.path. The source uses asrclayout, soharnessstill resolves to the installed distribution, and the existing "outside the checkout" assertions still run.slowmarker: registered inpyproject.tomland applied to 12 test functions (19 collected tests) that each took about 8 seconds or more in a measured full run (--durations=60). The golden report tests were left unmarked because they should always run. CI is unchanged and still runs the slow tests.CONTRIBUTING.mddocuments-m "not slow".test_local_audit_banner_has_no_pull_request_numbernow asserts on the rendered banner, including its English attribute, instead of readingreport.pyandreport_i18n.pysource text.test_rainbond_slices.pyandtest_rainbond_live_smoke.pymoved fromtests/trajectory_replay/public_webarena/totests/environments/. The README command path is updated, andmake public-webarena-report-auditnames the slice tests explicitly so that target keeps running them.The other
public_webarenatests that mention Rainbond exercise the public WebArena environment wiring and stay where they are. The golden snapshots are unchanged.Test plan
ruff check --select F,TID252over all Python, thenruff check): passed.tests/test_golden_reports.py: 17 passed on the final commit, no snapshot changes.real_smoke, before and after the change: 91 failed before, 89 failed after, and no test failed only after. The two that failed only before are intest_moli_provider.py, which this change does not touch; I did not investigate why they flipped.PYTHONPATHhere and used pytest's-o 'pythonpath=src .'instead, which does not reach subprocesses. Tests that spawnpython -m harness...therefore ran another checkout's code. I confirmed that cause on the four failures I inspected (for exampleinvalid choice: 'wcxb-score'), but did not triage all 89 individually.tests/package_smoke.pywas not run locally because it needs a clean install. The "Installation and packaging" check is the test for thesys.pathchange.