Skip to content

test(e2e): parse result.stdout for JSON to avoid stderr contamination#819

Merged
KayMKM merged 1 commit into
mainfrom
yuesu/fix-e2e-json-stdout
Jun 5, 2026
Merged

test(e2e): parse result.stdout for JSON to avoid stderr contamination#819
KayMKM merged 1 commit into
mainfrom
yuesu/fix-e2e-json-stdout

Conversation

@KayMKM
Copy link
Copy Markdown
Contributor

@KayMKM KayMKM commented Jun 5, 2026

The inspect/run/config E2E helpers parsed result.output, which under Click 8.4 interleaves stderr into stdout. After #793 made the logger attach a real stderr handler, -v/--verbose INFO lines landed in result.output and broke json.loads (JSONDecodeError on the leading log line). Parse the dedicated result.stdout channel instead, matching how real JSON consumers read these commands.

  • test_inspect_e2e.py: fixes the failing -v / -v-short tests (3 sites)
  • test_run_e2e.py: hardens 8 naive json.loads(result.output) sites
  • test_config_e2e.py: read stdout in _run_config (used by test_verbose_flag)

The inspect/run/config E2E helpers parsed result.output, which under
Click 8.4 interleaves stderr into stdout. After #793 made the logger
attach a real stderr handler, -v/--verbose INFO lines landed in
result.output and broke json.loads (JSONDecodeError on the leading
log line). Parse the dedicated result.stdout channel instead, matching
how real JSON consumers read these commands.

- test_inspect_e2e.py: fixes the failing -v / -v-short tests (3 sites)
- test_run_e2e.py: hardens 8 naive json.loads(result.output) sites
- test_config_e2e.py: read stdout in _run_config (used by test_verbose_flag)
@KayMKM KayMKM marked this pull request as ready for review June 5, 2026 07:04
@KayMKM KayMKM requested a review from a team as a code owner June 5, 2026 07:04
@KayMKM KayMKM merged commit 7ea8c48 into main Jun 5, 2026
9 checks passed
@KayMKM KayMKM deleted the yuesu/fix-e2e-json-stdout branch June 5, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants