Fix test suite stdout capture issue that forces junitxml workaround #178

Closed
opened 2026-07-05 13:58:51 -05:00 by jcwalker3 · 3 comments
Owner

Problem:
During validation for PR #176, the full pytest run produced swallowed or missing stdout because a test appears to close stdout mid-run. The agent used junitxml to recover reliable counts, reporting 681 tests, 0 fail, 0 error, 6 skip.

This workaround is acceptable for the run, but the test suite should not close or corrupt stdout because it weakens validation reporting and makes automated review harder.

Required behavior:

  1. Identify which test closes or corrupts stdout.
  2. Fix the test to use proper monkeypatch/capsys isolation.
  3. Ensure normal pytest output works without needing junitxml.
  4. Add regression coverage if appropriate.

Acceptance criteria:

  • venv/bin/pytest tests/ --ignore=branches prints normal summary output.
  • No test closes global stdout/stderr in a way that affects later tests.
  • Review agents can capture exact pass/fail counts without a workaround.

Priority: lower — validation workaround exists (junitxml counts); fix improves review-agent reporting quality per #173 exact-count requirements.

Problem: During validation for PR #176, the full pytest run produced swallowed or missing stdout because a test appears to close stdout mid-run. The agent used junitxml to recover reliable counts, reporting `681 tests, 0 fail, 0 error, 6 skip`. This workaround is acceptable for the run, but the test suite should not close or corrupt stdout because it weakens validation reporting and makes automated review harder. Required behavior: 1. Identify which test closes or corrupts stdout. 2. Fix the test to use proper monkeypatch/capsys isolation. 3. Ensure normal pytest output works without needing junitxml. 4. Add regression coverage if appropriate. Acceptance criteria: * `venv/bin/pytest tests/ --ignore=branches` prints normal summary output. * No test closes global stdout/stderr in a way that affects later tests. * Review agents can capture exact pass/fail counts without a workaround. Priority: lower — validation workaround exists (junitxml counts); fix improves review-agent reporting quality per #173 exact-count requirements.
jcwalker3 added the status:in-progress label 2026-07-05 14:09:27 -05:00
Author
Owner

PR #180 opened with output isolation fixes and regression tests for stdout usability. Full checks passed. Fresh branch from master. Scoped to test fixes per #178.

PR #180 opened with output isolation fixes and regression tests for stdout usability. Full checks passed. Fresh branch from master. Scoped to test fixes per #178.
Author
Owner

Acceptance-evidence requirement (operator triage of the authoring run; see #183 and the review note on PR #180, comment 3061):

This issue may only be closed when the closing PR (currently #180) demonstrates, at its pinned head, that ./venv/bin/python -m pytest tests/ --ignore=branches prints a normal pytest summary to the terminal without the junitxml workaround, and the exact visible summary is quoted in the review or PR. The authoring run's report did not include that canonical run; targeted tests and subprocess pipe capture are not sufficient proof for this issue's acceptance.

Also note PR #180's body uses Refs #178 (non-closing) — closure will need a body fix or an explicit post-merge close with status:in-progress removal.

Acceptance-evidence requirement (operator triage of the authoring run; see #183 and the review note on PR #180, comment 3061): This issue may only be closed when the closing PR (currently #180) demonstrates, at its pinned head, that `./venv/bin/python -m pytest tests/ --ignore=branches` prints a normal pytest summary to the terminal **without** the junitxml workaround, and the exact visible summary is quoted in the review or PR. The authoring run's report did not include that canonical run; targeted tests and subprocess pipe capture are not sufficient proof for this issue's acceptance. Also note PR #180's body uses `Refs #178` (non-closing) — closure will need a body fix or an explicit post-merge close with `status:in-progress` removal.
sysadmin removed the status:in-progress label 2026-07-05 14:26:34 -05:00
Author
Owner

Post-merge acceptance verification (closing the evidence gap from comment 3064 — the issue was closed without the required quoted summary):

Verified on merged master at 340b585bfdfdc267c4fc1aad26a38b9727091b6e (merge commit of PR #180), in a detached verification worktree with local HEAD proven equal to that SHA:

Command (canonical, no junitxml):

venv/bin/python -m pytest tests/ --ignore=branches

Exact visible tail of the output:

tests/test_review_pr.py ....                                             [ 91%]
tests/test_review_proofs.py .....................................        [ 96%]
tests/test_runtime_clarity.py .........                                  [ 98%]
tests/test_worktrees.py ............                                     [100%]

======================== 677 passed, 6 skipped in 7.55s ========================

Normal pytest progress output and the standard summary line now print to the terminal; stdout is no longer closed mid-run and no junitxml workaround was needed. Count reconciliation: pre-fix master reported 681 collected (675 passed + 6 skipped, recoverable only via junitxml); post-merge = 683 collected (677 passed + 6 skipped), consistent with the 2 regression tests PR #180 added.

Acceptance criteria of this issue are met on the merged head; closure stands. Evidence gathered under jcwalker3 / prgs-author (read-only local validation + this comment; no other mutations).

Post-merge acceptance verification (closing the evidence gap from comment 3064 — the issue was closed without the required quoted summary): Verified on merged `master` at `340b585bfdfdc267c4fc1aad26a38b9727091b6e` (merge commit of PR #180), in a detached verification worktree with local `HEAD` proven equal to that SHA: Command (canonical, no junitxml): ``` venv/bin/python -m pytest tests/ --ignore=branches ``` Exact visible tail of the output: ``` tests/test_review_pr.py .... [ 91%] tests/test_review_proofs.py ..................................... [ 96%] tests/test_runtime_clarity.py ......... [ 98%] tests/test_worktrees.py ............ [100%] ======================== 677 passed, 6 skipped in 7.55s ======================== ``` Normal pytest progress output and the standard summary line now print to the terminal; stdout is no longer closed mid-run and no junitxml workaround was needed. Count reconciliation: pre-fix master reported 681 collected (675 passed + 6 skipped, recoverable only via junitxml); post-merge = 683 collected (677 passed + 6 skipped), consistent with the 2 regression tests PR #180 added. Acceptance criteria of this issue are met on the merged head; closure stands. Evidence gathered under `jcwalker3 / prgs-author` (read-only local validation + this comment; no other mutations).
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#178