test(onboard): preserve runtime fixture isolation - #8557
Conversation
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesClone session isolation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests. E2E guidanceAdvisory only. A maintainer can dispatch the default E2E suite against this exact revision. Recommended E2E: None This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
<!-- markdownlint-disable MD041 --> ## Summary Nine config-generation suites carried a byte-identical BASE_ENV literal, six duplicated the buildTestEnv composition, and four the fake-openclaw stub writer. This is sequential PR 4 of issue #8289: it moves the ordinary valid generation environment, the stub writer, and the environment composition into `test/helpers/openclaw-env-fixture.ts` and migrates the nine suites. Following the isolation follow-up in #8557, the fixture ships with its own regression test proving per-call object independence. ## Related Issue Refs #8289 (sequential PR 4 of 4; PRs 1-3 are #8537, #8546, #8556) ## Changes - Add `test/helpers/openclaw-env-fixture.ts`: `baseOpenClawGenerationEnv()` returning a fresh copy of the ordinary valid environment per call, `ensureFakeOpenClaw(dir)`, and `buildOpenClawTestEnv(dir, baseEnv, overrides)` composing PATH, base entries, overrides, and HOME without mutating its inputs. - Add `test/helpers/openclaw-env-fixture.test.ts`: regression coverage for per-call independence and for composition that leaves base entries and overrides untouched, in the spirit of the #8557 isolation fix. - Migrate the nine suites with the byte-identical environment (`generate-openclaw-config` family, `generate-openclaw-tool-disclosure-config`, `agents-manifest-policy-conformance`, `generate-openclaw-config-plugin-entries`). The four suites whose BASE_ENV carries scenario-specific values (`reasoning-effort`, `security-audit`, `audit-suppressions-real`, `generate-hermes-config`) keep their local variants per the acceptance criteria, and the messaging-plan wrap stays at its call site. - Ratchet the `ci/test-file-size-budget.json` entry for `generate-openclaw-config.test.ts` from 1,941 to its new 1,915-line size, as the size gate requires after shrinking a legacy file. - Scope note: the issue's canonical corporate-CA test asset is deliberately not part of this PR. The inline PEM blocks are per-file scenario material (no two files share one), so canonicalizing them would change tested certificate content; that decision is left to a maintainer and can follow as its own change if wanted. ## 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: test fixtures only; no user-facing surface or documented behavior changes. - [ ] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [ ] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Documentation Writer Review - [x] Documentation writer subagent reviewed the completed changes - Result: `no-docs-needed` - Evidence: Test-only consolidation of repeated OpenClaw config-generation environments and an exact internal test-size-budget ratchet; no user-facing behavior, CLI, configuration, architecture, or documentation route changes. - Agent: Codex Desktop <!-- docs-review-head-sha: 251d5a1 --> <!-- docs-review-agents-blob-sha: 12ad395 --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: - Station profile/scenario: - Result: - Supporting evidence: ## Verification - [x] PR description includes a `Signed-off-by:` line and every commit appears as `Verified` in GitHub - [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, and `npm run check:diff` passed after the current-main refresh. - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result: after the current `main` refresh, `npx vitest run --project integration` on the nine migrated suites plus the new fixture test passed (10 files, 178 tests). `npm run typecheck:cli`, `npm run test-size:check`, the normal commit hooks, and pre-push checks passed. - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: - [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](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- Signed-off-by: JulienAu <16043912+JulienAu@users.noreply.github.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Standardized test environment setup across configuration and policy tests. * Added coverage for isolated fixtures, environment overrides, temporary-directory handling, and executable setup. * Updated the recorded test file size budget to reflect the reduced test footprint. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: JulienAu <16043912+JulienAu@users.noreply.github.com> Signed-off-by: Apurv Kumaria <akumaria@nvidia.com> Co-authored-by: JulienAu <16043912+JulienAu@users.noreply.github.com> Co-authored-by: Apurv Kumaria <akumaria@nvidia.com>
Summary
cloneSessionfrom #8546 returned the caller-owned session when normalization rejected its serialized copy. This follow-up keeps the serialized copy as the fallback so fixture mutations cannot alter caller-owned top-level or nested state.Changes
test/helpers/onboard-final-flow-phases.ts,src/lib/onboard/resume-machine-repair.test.ts,src/lib/onboard/runtime-boundary-step-result.test.ts, andsrc/lib/onboard/runtime-boundary.test.ts. Their callers construct valid sessions and do not expose test(onboard): add an in-memory machine runtime fixture #8546's independent-mutation contract, so this PR does not change them.Type of Change
Quality Gates
Documentation Writer Review
no-docs-neededtest/helpers/onboard-machine-runtime-fixture.tsandtest/helpers/onboard-machine-runtime-fixture.test.ts. The reviewer found no user-visible behavior or documentation impact and approved the test title and existing JSDoc ownership.DGX Station Hardware Evidence
scripts/prepare-dgx-station-host.shdoes not change.Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run validate:prpassed after refreshingorigin/mainwhen hooks were skipped or unavailablenpx vitest run --project integration test/helpers/onboard-machine-runtime-fixture.test.tspassed 1/1; the eight test(onboard): add an in-memory machine runtime fixture #8546 CLI suites passed 63/63;npm run typecheck:clipassed;npm run test:projects:checkreported exact membership for 2,231 candidate files across seven projects.npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result: not applicable. The change updates one fixture fallback and adds one focused test; targeted validation covers every test(onboard): add an in-memory machine runtime fixture #8546 consumer.npm run docsbuilds without warnings (doc changes only)Signed-off-by: Julie Yaunches jyaunches@nvidia.com
Summary by CodeRabbit
Bug Fixes
Tests