test(openclaw): add a config-generation environment fixture - #8559
test(openclaw): add a config-generation environment fixture#8559JulienAu wants to merge 6 commits into
Conversation
|
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR adds shared OpenClaw test-environment helpers, migrates generation tests to use them, adds fixture coverage, and updates the test file-size budget. ChangesOpenClaw fixture refactor
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Nine config-generation suites carried a byte-identical BASE_ENV literal, six duplicated the buildTestEnv composition, and four the fake-openclaw stub writer. Move the ordinary valid generation environment, the stub writer, and the env composition into test/helpers/openclaw-env-fixture.ts, returning fresh objects per call. The four suites whose BASE_ENV carries scenario-specific values keep their local variants, and the messaging-plan wrap stays at its call site. Every migrated file has a negative line delta, and the fixture carries its own regression test proving per-call object independence. Refs NVIDIA#8289 Signed-off-by: JulienAu <16043912+JulienAu@users.noreply.github.com>
dd3e824 to
f133ae5
Compare
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. 2 semantic terminology decisionsTerminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.
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. |
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
|
Maintainer follow-up on branch revision
|
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com> # Conflicts: # ci/test-file-size-budget.json
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.tsand 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
test/helpers/openclaw-env-fixture.ts:baseOpenClawGenerationEnv()returning a fresh copy of the ordinary valid environment per call,ensureFakeOpenClaw(dir), andbuildOpenClawTestEnv(dir, baseEnv, overrides)composing PATH, base entries, overrides, and HOME without mutating its inputs.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 test(onboard): preserve runtime fixture isolation #8557 isolation fix.generate-openclaw-configfamily,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.ci/test-file-size-budget.jsonentry forgenerate-openclaw-config.test.tsfrom 1,941 to its new 1,915-line size, as the size gate requires after shrinking a legacy file.Type of Change
Quality Gates
Documentation Writer Review
no-docs-neededDGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, andnpm run check:diffpassed after the current-main refresh.mainrefresh,npx vitest run --project integrationon 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.npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result:npm run docsbuilds without warnings (doc changes only)Signed-off-by: JulienAu 16043912+JulienAu@users.noreply.github.com
Summary by CodeRabbit