Skip to content

[red-knot] mdtest runner: include stderr for crashing tests - #15644

Merged
sharkdp merged 1 commit into
mainfrom
david/mdtest-runner-include-stderr
Jan 21, 2025
Merged

[red-knot] mdtest runner: include stderr for crashing tests#15644
sharkdp merged 1 commit into
mainfrom
david/mdtest-runner-include-stderr

Conversation

@sharkdp

@sharkdp sharkdp commented Jan 21, 2025

Copy link
Copy Markdown
Contributor

Summary

Test executables usually write failure messages (including panics) to stdout, but I just managed to make a mdtest crash with

thread 'mdtest__unary_not' has overflowed its stack
fatal runtime error: stack overflow

which is printed to stderr. This test simply appends stderr to stdout (stderr=subprocess.STDOUT can not be used with capture_output)

Test Plan

Make sure that the error message is now visible in the output of uv -q run crates/red_knot_python_semantic/mdtest.py

@sharkdp sharkdp added the ty Multi-file analysis & type inference label Jan 21, 2025
# Skip 'cargo test' boilerplate at the end
break
self._print_trimmed_cargo_test_output(
output.stdout + output.stderr, test_name

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

output.stdout + output.stderr is the only relevant change. I just moved some code into a separate function.

@sharkdp
sharkdp enabled auto-merge (squash) January 21, 2025 14:56
@sharkdp
sharkdp merged commit 13a6b56 into main Jan 21, 2025
@sharkdp
sharkdp deleted the david/mdtest-runner-include-stderr branch January 21, 2025 14:59
@github-actions

Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

dcreager added a commit that referenced this pull request Jan 21, 2025
* main:
  Separate grouped and ungrouped nodes more clearly in AST generator (#15646)
  [`flake8-simplify`] Mark fixes as unsafe (`SIM201`, `SIM202`) (#15626)
  [red-knot] mdtest runner: include stderr for crashing tests (#15644)
  Change `EnvironmentOptions::venv-path` to `Option<SystemPathBuf>` (#15631)
  [`flake8-type-checking`] Fix some safe fixes being labeled unsafe (#15638)
  feat: Update RUF055 to do var == value (#15605)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants