Skip to content

Fix urtest.sh with no arguments on bash 3.2 - #406

Merged
bneradt merged 1 commit into
yahoo:masterfrom
bneradt:fix-urtest-empty-args
Oct 13, 2026
Merged

bneradt merged 1 commit into
yahoo:masterfrom
bneradt:fix-urtest-empty-args

Conversation

@bneradt

@bneradt bneradt commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Running the generated build/dev/urtest.sh without any pytest arguments
failed immediately on macOS, whose /bin/bash is 3.2, with
"pytest_arguments[@]: unbound variable". The wrapper runs under
set -u, and bash versions before 4.4 treat expanding an empty array as
a reference to an unset variable.

This patch guards the expansion with the ${array[@]+"${array[@]}"}
idiom in the urtest.sh template, so an empty argument list expands to
nothing while non-empty arguments are still passed through with their
original word boundaries. The full Uranium suite and a -k filtered run
both pass with the regenerated wrapper on macOS.

Co-authored-by: Claude Opus 5.5 Medium [email protected]

🤖 Generated with Claude Code

Running the generated build/dev/urtest.sh without any pytest arguments
failed immediately on macOS, whose /bin/bash is 3.2, with
"pytest_arguments[@]: unbound variable". The wrapper runs under
set -u, and bash versions before 4.4 treat expanding an empty array as
a reference to an unset variable.

This patch guards the expansion with the ${array[@]+"${array[@]}"}
idiom in the urtest.sh template, so an empty argument list expands to
nothing while non-empty arguments are still passed through with their
original word boundaries. The full Uranium suite and a -k filtered run
both pass with the regenerated wrapper on macOS.

Co-authored-by: Claude Opus 5.5 Medium <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 16:46
@bneradt bneradt self-assigned this Oct 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@bneradt bneradt added the bug Something isn't working label Oct 13, 2026
@bneradt
bneradt merged commit 5772190 into yahoo:master Oct 13, 2026
6 checks passed
@bneradt
bneradt deleted the fix-urtest-empty-args branch October 13, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants