Repository navigation
test(workflows): pin numeric equality on captured shell stdout with trailing newline - #5357
Merged
mnriem merged 1 commit intoNov 10, 2026
Conversation
…railing newline Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The review records no active issues, and the change is limited to focused regression coverage for shell-output comparisons.
No open issues 🎉
What changed in this PR
Adds end-to-end regression coverage for numeric comparisons against shell-step stdout with a trailing newline. Runtime behavior is unchanged.
Changes:
- Tests equality, inequality, and ordering comparisons against captured stdout.
- Covers decimal values and non-numeric string fallback behavior.
- Verifies raw stdout retains its trailing newline and conditional branches behave correctly.
| File | Description |
|---|---|
tests/workflows/test_shell_step.py |
Adds parametrized engine-level coverage for numeric and string comparisons on captured shell output. |
Review effort: Lite (auto)
Collaborator
|
Thank you! |
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.
Description
#5310 made
==and!=coerce numeric strings the same way>,<,>=and<=already did, so captured stdout such as"10"is now== 10. Its regression test used a hand-builtStepContextwithstdout: "10". Real shell output keeps its trailing newline (echo 10captures"10\n"), and no test covered that path end to end.This adds one parametrized test to
tests/workflows/test_shell_step.py, written like the existing engine-level tests in that file. A shell step prints a value and anifstep branches onsteps.count.output.stdout. The test checks:== 10/!= 11takethen, and!= 10/== 11takeelse, for stdout"10\n">= 10and<= 10agree with==on the same value"2.5\n" == 2.5) compares as a number"10x\n") is still compared as a string, so== 10is false and!= 10is truestdoutfield still keeps its trailing newlineThis only adds tests. Runtime behavior is unchanged.
Testing
Set up this checkout's
.venvand editable install using the local development guide. Run commands from the checkout root.Ran in a clean
python:3.14container:Result: pytest collected 160 items in
tests/workflows/test_shell_step.pyand reported160 passed in 1.12s.ruff checkon the same file reportedAll checks passed!. The command exited with status 0..venv/bin/specify --help(Windows PowerShell:.\.venv\Scripts\specify.exe --help).venv/bin/python -m pytest tests -q(Windows PowerShell:.\.venv\Scripts\python.exe -m pytest tests -q); use affected test paths for focused checks andLC_ALL=en_US.UTF-8on macOSAI Disclosure
AI disclosure: Written by Claude Code (model: Claude Opus 5.5, low reasoning effort, autonomous) on behalf of Rohan Bharti. The agent picked the gap, wrote the test and wrote this description. Nobody reviewed the change line by line before it was opened.
Prepared with AI assistance (Claude Code). The tests described above were run before opening this PR. The submitter reviewed the diff before it was opened.