fix(test): update onboard test mocks to match shell-quoted sandboxName#1566
fix(test): update onboard test mocks to match shell-quoted sandboxName#1566
Conversation
The shell-quoting security fix (8f8b4e7) wrapped sandboxName with shellQuote() in exec and DNS proxy commands, but the test mocks still matched the unquoted format causing 4 CI failures (3 timeouts, 1 assertion error). Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughUpdated test logic: onboarding test matchers now detect Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
NVIDIA#1566) ## Summary - Update 6 `runCapture` mock matchers in `test/onboard.test.js` to match the shell-quoted sandbox name format introduced by 8f8b4e7 - The security fix wrapped `sandboxName` with `shellQuote()` in exec and DNS proxy commands, but the test mocks still matched the old unquoted format (`sandbox exec my-assistant curl` vs `sandbox exec 'my-assistant' curl`) - This caused 4 CI failures: 3 timeouts (dashboard readiness loop never matched) and 1 assertion error (`null !== 0`) ## Test plan - [x] `npx vitest run` — all 1126 tests pass (67 files, 0 failures) - [x] All pre-commit and pre-push hooks pass Fixes the CI break introduced by NVIDIA#1392. Signed-off-by: Aaron Erickson <aerickson@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Updated test matchers to correctly detect sandbox invocations that use a quoted sandbox name in command strings. * Simplified test logic for scanning run/runCapture templates into an equivalent single-line expression, preserving existing violation detection and assertions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Summary
runCapturemock matchers intest/onboard.test.jsto match the shell-quoted sandbox name format introduced by 8f8b4e7sandboxNamewithshellQuote()in exec and DNS proxy commands, but the test mocks still matched the old unquoted format (sandbox exec my-assistant curlvssandbox exec 'my-assistant' curl)null !== 0)Test plan
npx vitest run— all 1126 tests pass (67 files, 0 failures)Fixes the CI break introduced by #1392.
Signed-off-by: Aaron Erickson aerickson@nvidia.com
Summary by CodeRabbit