-
Notifications
You must be signed in to change notification settings - Fork 213
fix: incompatible test script on wsl #1207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
bash grammer {1..60} is not supported in wsl default shell
Signed-off-by: zhuangqh <[email protected]>
WalkthroughSubprocess.run calls are explicitly configured to use Bash as the shell executable in two files by adding the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
tests/llm/utils/commands.py (1)
42-49: Consider addingexecutable="/bin/bash"to other subprocess calls for consistency.While these kubectl diagnostic commands may not currently use bash-specific syntax, adding
executable="/bin/bash"would ensure consistency and prevent similar compatibility issues in the future if these commands are modified.🔎 Proposed changes for consistency
For line 42-49:
pod_status_result = subprocess.run( diagnostic_cmd, shell=True, + executable="/bin/bash", capture_output=True, text=True, timeout=5, cwd=test_case.folder, )For line 63-70:
ns_result = subprocess.run( ns_cmd, shell=True, + executable="/bin/bash", capture_output=True, text=True, timeout=5, cwd=test_case.folder, )For line 80-87:
events_result = subprocess.run( events_cmd, shell=True, + executable="/bin/bash", capture_output=True, text=True, timeout=5, cwd=test_case.folder, )Also applies to: 63-70, 80-87
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
scripts/run_eval_setup.py(1 hunks)tests/llm/utils/commands.py(1 hunks)
🧰 Additional context used
🪛 Ruff (0.14.8)
scripts/run_eval_setup.py
43-43: subprocess call with shell=True identified, security issue
(S602)
🔇 Additional comments (2)
tests/llm/utils/commands.py (1)
160-160: LGTM! Explicit bash execution fixes WSL compatibility.This change correctly addresses the issue where bash-specific syntax (like brace expansion
{1..60}) fails when the system default shell is not bash. The addition ofexecutable="/bin/bash"ensures bash is used regardless of the default shell on WSL or other systems.scripts/run_eval_setup.py (1)
43-43: LGTM! Change ensures bash execution for test commands.The addition of
executable="/bin/bash"correctly addresses the WSL compatibility issue by ensuring bash-specific syntax in test commands executes properly.Regarding the static analysis warning (S602) about
shell=True: This is acceptable in this context since the commands come from test YAML files (trusted sources) rather than user input, and this is a development/test script rather than production code.
bash grammer {1..60} is not supported in wsl default shell
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.