ci(platform): stabilize macOS and WSL Vitest - #6825
Conversation
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
📝 WalkthroughWalkthroughThe PR updates platform Vitest workflow setup and contract coverage, hardens Hermes main-module detection, and adjusts tests for platform-specific paths, process timing, command invocation, Linux-only behavior, and shell output. ChangesPlatform Vitest workflow contracts
Hermes module detection
Cross-platform test portability
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage remains at 96%, unchanged from the TypeScript / code-coverage/cliThe overall coverage in the Show a code coverage summary of the most impacted files.
Updated |
PR Review Advisor — InformationalAdvisor assessment: Informational / medium confidence Model lanes
Nemotron is a non-blocking second opinion. Its prose, findings, and E2E guidance do not change the primary assessment above and remain in workflow artifacts only. E2E guidanceAdvisory only: coverage and selector recommendations are non-authoritative. E2E / PR Gate independently computes and dispatches trusted jobs without consuming this output. Recommended coverage:
1 warning · 0 optional suggestionsWarningsThese merit maintainer attention but do not block by themselves.
|
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/repro-5978-policy-denial-hint.test.ts`:
- Around line 99-102: Update the non-Darwin command construction in the
scriptArgs assignment to shell-escape or quote the interpolated file path within
the script -c command. Preserve the existing command flags and behavior while
ensuring paths containing spaces or shell metacharacters are passed as a single
safe argument.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 4e079e19-9cb3-4cdb-8677-9963171ab4da
⛔ Files ignored due to path filters (1)
ci/platform-vitest-macos-requirements.lockis excluded by!**/*.lock
📒 Files selected for processing (17)
.github/workflows/platform-vitest-main.yamlagents/hermes/generate-config.tsci/source-shape-test-budget.jsonsrc/lib/onboard/docker-driver-gateway-compat-container.test.tssrc/lib/tunnel/gateway-stop-script.test.tstest/e2e/support/e2e-fixture-context.test.tstest/gateway-supervisor-control.test.tstest/helpers/vitest-watch-triggers.tstest/langchain-deepagents-code-managed-mcp-hardening.test.tstest/local-credential-helper-suite.tstest/onboard-model-router.test.tstest/platform-vitest-main-workflow.test.tstest/pr-review-advisor.test.tstest/pr-workflow-contract.test.tstest/repro-5978-policy-denial-hint.test.tstest/sandbox-init.test.tstest/vitest-watch-triggers.test.ts
| const scriptArgs = | ||
| process.platform === "darwin" | ||
| ? ["-q", "/dev/null", "bash", "--noprofile", "--norc", "-i", file] | ||
| : ["-qec", `bash --noprofile --norc -i ${file}`, "/dev/null"]; |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Quote the path in the non-Darwin script -c command. The raw ${file} interpolation can split on spaces or treat shell metacharacters as syntax; shell-escape it before building the -c string.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@test/repro-5978-policy-denial-hint.test.ts` around lines 99 - 102, Update the
non-Darwin command construction in the scriptArgs assignment to shell-escape or
quote the interpolated file path within the script -c command. Preserve the
existing command flags and behavior while ensuring paths containing spaces or
shell metacharacters are passed as a single safe argument.
<!-- markdownlint-disable MD041 --> ## Summary Closes the remaining failures exposed by the Platform Vitest main watch across WSL and macOS. The patch fixes the original WSL gateway-owner mismatch, supplies the missing macOS fd dependency, makes Shields timer takeover fail closed around PID reuse and late descendants, and makes the WSL root-only Hermes fixtures traversable by the intended peer without weakening their contents. ## Related Issue Follow-up to #6825; preserves the bare-gateway stop behavior from #4951. ## Changes - Compare gateway process and identity-file owners by stable numeric UID instead of width-limited account names. - Install fd in the macOS platform lane and pin that dependency in the workflow contract. - Bound Shields process inspection, verify start identity immediately before signaling, stop the exact owner before enumerating descendants, and require a quiescent descendant pass. - Add deterministic PID-reuse, transient-inspection, stop-ordering, and non-quiescent-tree regressions. - Grant temporary execute-only traversal for the two WSL root peer fixtures, restore the shared temp-root mode, and return locked fixtures to mutable before cleanup. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [ ] Docs updated for user-facing behavior changes - [x] Docs not applicable — justification: These are internal platform-CI and process-safety corrections; the documented tunnel and timer contracts do not change. - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [x] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: Independent security review found no blockers. Exact process identity is the final pre-signal verification, zombies are treated as gone, replacement PIDs receive no stop or kill signal, and non-quiescent trees remain frozen and fail closed. - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Verification - [x] PR description includes the DCO sign-off declaration and every commit appears as Verified in GitHub - [x] Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run check:diff passed when hooks were skipped or unavailable - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — npm run test:changed: 82 files and 735 tests passed; focused platform and Shields tests: 23 passed; CLI typecheck and build passed; integration fixtures: 9 passed with 2 root-only tests skipped locally; project membership and structural checks passed. - [ ] Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — authoritative branch Platform Vitest run is being dispatched on real macOS and WSL runners. - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] npm run docs builds without warnings (doc changes only) - [ ] Doc pages follow the style guide (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- Signed-off-by: Charan Jagwani <cjagwani@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved shield recovery/takeover reliability with deadline-bounded process inspection, more deterministic hung-owner handling, and stronger “current vs gone” verification. - Prevented unsafe signaling during takeover by identity-based recovery-tree exclusion and tighter freeze/kill escalation logic. - Hardened Linux gateway shutdown by switching process authorization and PID discovery to numeric UID checks. - **Tests** - Added deadline behavior coverage and expanded shield takeover/recovery tests for hung and PID-reuse replacement scenarios. - Updated gateway stop-script and Hermes restart fixture tests, including stricter permission handling and cleanup. - **Chores** - Added `fd` to macOS CI dependency installation. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Charan Jagwani <cjagwani@nvidia.com> Signed-off-by: Carlos Villela <cvillela@nvidia.com> Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Summary
Stabilizes the main-branch Platform Vitest workflow after the previous WSL fix left three residual WSL failures and macOS still failed 216 tests. The workflow now provisions the runtime its cross-platform tests require, while genuine Darwin and WSL timing/path differences are handled explicitly.
Changes
/procargv transition races.Type of Change
Quality Gates
Verification
Verifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run check:diffpassed when hooks were skipped or unavailablenpm run test:changedpassed (31 passed, 15 Linux-only skipped on Darwin).npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result: awaiting the branch-dispatched Platform Vitest workflow on real macOS and WSL runners.npm run docsbuilds without warnings (doc changes only)Signed-off-by: Charan Jagwani cjagwani@nvidia.com
Summary by CodeRabbit
CI Improvements
Bug Fixes
Tests