Repository navigation
Conversation
The cold/warm wall-time and spawn-count numbers `test_session_start_windows_benchmark_669.py` already measures on every run reached no human: `record_property` only lands in a JUnit XML this repo's workflow never writes, and pytest only shows captured stdout for a failed test. Append a small Markdown table to `$GITHUB_STEP_SUMMARY` from the test itself -- zero workflow change, since GitHub Actions already hands that env var to every step of every job -- and print the same table to stdout and stderr so it also lands in the job log. Appending degrades silently to a no-op when the variable is unset (the ordinary local pytest run); a genuinely unwritable path raises loudly instead of dropping the table a second time. Closes #673 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01ScdCn6Xq622o2cRQhzVhi5
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.
Closes #673
What was wrong
tests/test_session_start_windows_benchmark_669.py(#669) already measures cold/warm wall-time and spawn-count forsession-start-hook.sh, for two scenarios (jq present, jq absent), on every leg of the existing 3-OS x 4-Python-version CI matrix. None of those numbers reached a human:record_propertyonly lands in a JUnit XML this repo's.github/workflows/tests.ymlnever writes or uploads, and pytest only shows captured stdout for a failed test (no-s/-rAin this repo'saddopts).What changed
_format_benchmark_table(...): a small pure function building a Markdown table (platform, one row per cold/warm, wall-ms, spawn count) for one scenario._append_step_summary(table): appends that table to$GITHUB_STEP_SUMMARYwhen that env var is set. Degrades silently to a no-op when unset (the ordinary localpytestrun). Lets a realOSErrorpropagate uncaught when the var is set but the path is unwritable -- deliberately not caught, so a genuine CI misconfiguration is never silently swallowed._benchmark()(the existing helper both scenario tests call) now also prints the table to stdout and stderr (previously only a one-line summary to stdout), and calls_append_step_summary.changelog.d/673.added.md.The hidden judgment call, and why
The issue offered three routes:
$GITHUB_STEP_SUMMARY, a--junitxmlplus uploaded artifact, or a scoped-rAoverride. I picked$GITHUB_STEP_SUMMARYalone. It is literally zero workflow-file change -- confirmed by reading.github/workflows/tests.ymldirectly rather than trusting the issue's own framing: its one "Run tests" step is a barerun: pytest, and GitHub Actions hands that env var to every step's environment with no opt-in needed, so the childpytestprocess inherits it for free. It reaches all three OSes x four Python versions the same way the benchmark module itself already does. The junit/artifact route would need an actual workflow edit for a module whose own docstring already argues against paying a dedicated-CI-job cost for exactly this reason -- the same argument extends to a dedicated junit-upload step for one module. I judged the cheaper, already-sufficient fix correct rather than layering the other two on top.The issue's own wording for the negative control ("the test still fails loudly ... when $GITHUB_STEP_SUMMARY is unwritable, e.g. unset, or a read-only path") reads as though unset and set-but-unwritable should both fail loudly. Taken literally, every ordinary local
pytestrun -- which never has this variable -- would start failing, breaking local dev with no CI benefit (CI always sets it). I split this into two deliberately different behaviours instead: unset degrades silently (matches every run before this issue existed, and keeps the existing CI matrix green exactly as before); set-but-genuinely-unwritable raises loudly and uncaught, because that is a real misconfiguration worth surfacing. This is the judgment call the brief asked me to make explicit -- see_append_step_summary's own docstring in tests/test_session_start_windows_benchmark_669.py.Tests
Red (new test functions referencing then-undefined helpers): 4 failed, 3 deselected in 0.38s.
Green, targeted (-k step_summary): 4 passed, 3 deselected in 0.28s.
Green, whole module, GITHUB_STEP_SUMMARY set to a real writable temp file: 7 passed in 6.51s (and the file was confirmed to receive two well-formed Markdown tables, one per scenario).
Green, whole module, GITHUB_STEP_SUMMARY unset (the universal local-dev case): 7 passed in 5.35s.
Not run: the repo's full test_command (pytest) -- narrowed to the one changed test module per this plugin's own developer brief; CI is the gate for the full matrix.
Review
Both self-review spawns (Explore as a generalist reviewer, oss:auditor for the fixed cross-platform checklist) returned NO FINDINGS, classified via scripts/review_return.py rather than by eye. Platform-band verdict: clean, REASONED (no Windows/Linux machine available to this lane; all claims are a static read of the diff, cross-checked against what CI's own matrix already exercises).
Generated with Claude Code: https://claude.com/claude-code
https://claude.ai/code/session_01ScdCn6Xq622o2cRQhzVhi5
[AI-generated]