Repository navigation
Merged
Conversation
…erclaiming coverage a manual after `## Data files` -- computing the slug outside bash, reading the transcript path the host hands us, configuration, measuring lock hold times, external storage mode, and running tests. Each moves verbatim to docs/<slug>.md, replaced in README by a one-line pointer under a new `## Reference` heading. Every internal anchor link that crossed the move (README -> moved section, moved section -> README, and moved section -> a different moved section) is repointed at its new file; two tests that pinned text out of the Configuration table -- test_config_contract.py and test_prompt_stamp_301.py -- now read docs/configuration.md instead of README.md. README.md is 438 lines now. of 1960 collected tests skip -- roughly 61%, from a sys.platform == "win32" blanket-skip now on 107 of 174 test modules (up from #497's own count of 92, recomputed here rather than trusted). The README's OS badge said "tested on Linux | macOS | Windows" with nothing distinguishing that from full coverage. A one-line caveat now sits next to the badge, and a new pytest_terminal_summary hook (scripts/report_windows_skip_floor.py, wired into conftest.py alongside the existing #510 duration reporter) prints the current leg's own skip ratio on every pytest run -- local or any leg of the CI matrix, no extra flag -- annotating with a ::warning:: GitHub Actions command when a Windows leg crosses a recorded 10% skip floor (the issue's own suggested starting point). Deliberately a report, not a build-failing gate, the same choice #510 already makes for its own reporter: today's ratio is already far past 10%, so failing the build on it would redden every future Windows leg until the modules behind it migrate to resolve_bash() (#432), a separate and much larger effort #497 tracks on its own -- no change to .github/workflows/tests.yml was needed, since the hook already runs on the bare `pytest` invocation that step makes. Closes #505 Closes #507 Co-Authored-By: Max <noreply>
… checks, stale prose Both spawned reviewers (Explore and oss:auditor, independently, against commit 7255d48) found the same real defects in that commit: 1. docs/running-tests.md dropped the `### Measuring the warm path (`tests/env_cache.py`)` subsection heading during the #505 move -- its body silently reattached under the new "### The Windows leg's own skip ratio" heading instead, contradicting the commit's own "moved verbatim" claim. Restored the heading; the section is now byte-identical to the pre-move README except for the one new subsection deliberately inserted ahead of it. 2. tests/test_readme_reference_move_505.py only asserted content equality for 2 of the 6 moved sections, which is why finding 1 passed cleanly. Added a distinctive verbatim sentence per section (all 6 now) plus a stronger check: every ###/#### interior heading each section carried before the move must still be a heading (not just present as reattached text) in its new file -- this is what actually catches finding 1's shape of regression, confirmed red against a reintroduction of the bug and green against the fix. 3. conftest.py's #507 block computed `total` by summing each `terminalreporter.stats` category's report *count*, which double-counts any test whose teardown errors separately from its call-phase outcome (a passing test with a failing teardown produces both a "passed" and an "error" stats entry for the same nodeid) -- silently diluting the reported skip ratio below the true one, the exact failure mode #507 exists to prevent, reproduced inside its own arithmetic. Now counts distinct nodeids instead. Verified against a live pytest run with a teardown-erroring fixture (33.3% true ratio vs. 20% under the old, diluted count) and pinned with two new tests in tests/test_conftest_skip_floor_hook_507.py that call conftest.py's real `pytest_terminal_summary` directly with a monkeypatched `sys.platform` and hand-built fake reports -- driving the actual `is_windows == "win32"` wiring end to end for the first time, rather than only the pure `analyze()` function with hand-fed integers (the previous version of this file also carried an unused `monkeypatch` parameter on one test, suggesting an intended Windows-branch test had been dropped; removed the unused parameter and added the two tests that should have used it). Monkeypatching `sys.platform` inside a nested nested-pytest-session (`runpytest_inprocess`) was tried first and rejected: it breaks pytest's own internal `_windowsconsoleio_workaround`, which reads `sys.platform` during that nested session's own startup, on a non-Windows host -- calling `pytest_terminal_summary` directly with a fake terminalreporter avoids starting a second pytest session altogether. 4. tests/test_transcript_path_trust_431.py and tests/test_predictable_tmp_429.py still said "README.md's transcript-path section" / "README.md's own documented config key" -- both sections moved to docs/ in the #505 commit these files were not part of. Repointed both. All fixes verified red-before/green-after where the defect was regression- testable (findings 1 and 3); the two test-adequacy findings (2 and the monkeypatch gap in item 3) are closed by the strengthened tests themselves. Co-Authored-By: Max <noreply>
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.
#505 -- move README's 6 reference sections to docs/
README.md was 934 lines because it doubled as a reference manual after
## Data files. Six sections -- Computing the slug outside bash, Reading the transcript path the host hands us, Configuration, Measuring lock hold times, External storage mode, Running tests -- move verbatim todocs/<slug>.md, each replaced in README by a one-line pointer under a new## Referenceheading. README.md is 438 lines now.Every internal markdown anchor link that crossed a section boundary during the move is repointed at its new file -- README -> moved section, moved section -> README, and moved section -> a different moved section. Two existing tests that pinned text out of the Configuration table (
tests/test_config_contract.py,tests/test_prompt_stamp_301.py) now readdocs/configuration.mdinstead ofREADME.md.tests/test_readme_reference_move_505.pypins the move: all six headings gone from README, a## Referencesection pointing at all six docs files, a distinctive verbatim sentence and every interior heading from each original section surviving in its new file, and no README-internal anchor left dangling.#507 -- the OS badge overclaimed Windows test coverage
#497 measured the
windows-latestCI legs reportingsuccesswhile 1201 of 1960 collected tests skip -- roughly 61%, from asys.platform == "win32"blanket-skip pattern. Recomputed on this tree rather than trusted: 107 of 174 test modules now blanket-skip on win32 (up from #497's own count of 92), and 9 modules (not counting the helper) use theresolve_bash()route that was supposed to retire that pattern.A one-line caveat now sits next to the README's OS badge. A new
scripts/report_windows_skip_floor.pymodule, wired into the existingpytest_terminal_summaryhook inconftest.py(alongside the #510 duration reporter, in its owntry/except), prints the current run's own skip ratio on everypytestinvocation -- local or any leg of the CI matrix, no extra flag needed -- and annotates with a::warning::GitHub Actions command when a Windows leg crosses a recorded 10% skip floor (the issue's own suggested starting point).Judgment call, argued rather than looked up: this is deliberately a report, never a build-failing gate -- the same choice #510 already makes for its own reporter. Today's actual ratio is already far past 10%, so failing the build on it would redden every future Windows leg until the modules behind it migrate to
resolve_bash()(#432), a separate and much larger effort #497 tracks on its own and which this lane was explicitly told not to attempt. No.github/workflows/tests.ymlchange was needed -- the hook fires automatically on the barepytestinvocation that step already runs.Verified without a live Windows CI run (reasoned, not observed, nobody on this project has a Windows box): the pure
analyze()/format_report()/github_actions_warning()functions are unit-tested directly with paired positive/negative controls, and two integration tests callconftest.py's realpytest_terminal_summarywith a monkeypatchedsys.platformand a hand-built faketerminalreporterto drive the real stats-extraction wiring end to end (monkeypatchingsys.platforminside a nested pytest session was tried first and rejected -- it breaks pytest's own internal Windows-console workaround, which readssys.platformduring that nested session's own startup, observed directly as anAttributeErroron a non-Windows host).Self-review
Two spawned reviewers (
Exploreandoss:auditor, independently, plus one permitted re-spawn of the auditor after its first return was classifiedreferred-not-stated) found five real defects in the first commit, all fixed in the second:docs/running-tests.mddropped a subsection heading (### Measuring the warm path) during the splice -- its body silently reattached under the wrong heading, contradicting the "moved verbatim" claim. Restored; the file is now byte-identical to the pre-move README section except for the one deliberately-inserted new subsection.tests/test_readme_reference_move_505.pyonly checked 2 of 6 moved sections' content -- exactly why finding 1 passed clean. Strengthened to check all 6, plus a stronger interior-heading-survival assertion, confirmed red against a reintroduction of finding 1's bug.tests/test_conftest_skip_floor_hook_507.pynever drove the real Windows branch end to end. Added two tests that call the real hook directly with a monkeypatched platform and fake stats.conftest.py'stotalcomputation double-counted any test with a separately-erroring teardown, diluting the reported skip ratio. Fixed to count distinct nodeids; verified against a live reproduction (33.3% true ratio vs. 20% under the old, diluted count) and pinned with a regression test.docs/. Repointed both.Closes #505
Closes #507