[Test] Loosen managed-job --tail invalid-int assertion#9970
[Test] Loosen managed-job --tail invalid-int assertion#9970kevinmingtarja wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates a smoke test in tests/smoke_tests/test_managed_job.py to make the validation of CLI argument parser errors more flexible by using a case-insensitive regex pattern. The reviewer noted that the new pattern "invalid|not a valid" is too broad and could cause false positives, such as matching unrelated errors like "Invalid job ID". They suggested a more specific regex pattern to target integer, numeric, or tail-related validation errors.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
2961e6d to
4ef9c08
Compare
test_managed_jobs_logs_tail checks that `sky jobs logs --tail <non-int>`
is rejected, but it grepped for the exact error string
("is not a valid integer"). Match the rejection without pinning the exact
wording, which is an implementation detail of the integer parser.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4ef9c08 to
fc02bcc
Compare
Summary
test_managed_jobs_logs_tailverifies thatsky jobs logs --tail <non-integer>is rejected. The assertion grepped for the exact error string
(
is not a valid integer), which is more brittle than the test intends — thepoint is that the bad value is rejected, not the exact wording the integer
parser uses to report it.
This relaxes the grep to match the rejection by the integer parser without
pinning the exact wording, while staying specific enough to avoid matching
unrelated errors that merely contain "invalid" (e.g. a job-id error).
Test plan
grep -iE "invalid.*(int|num|tail)|not a valid") stillmatches the current error output, so the rejection continues to be asserted.