fix(test): move installer integration tests to CI-only vitest project#2435
Conversation
Tests that spawn `bash install.sh` or `bash install-openshell.sh` flake under the default 5s vitest timeout on loaded hosts. Set describe-level timeout to 15s for both test suites. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughTwo test suites set explicit 15s Vitest timeouts; Vitest config adds a gated Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
These are integration tests that spawn real bash processes — they belong in CI, not in the pre-push hook. Add a new `installer-integration` vitest project enabled only when CI=1 or NEMOCLAW_RUN_INSTALLER_TESTS=1. Exclude the two files from the `cli` project so pre-push hooks skip them. Run explicitly: npx vitest run --project installer-integration Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@vitest.config.ts`:
- Line 32: The enabled flag currently uses "!!process.env.CI ||
!!process.env.NEMOCLAW_RUN_INSTALLER_TESTS" which treats any non-empty string
(e.g. "0" or "false") as true; change it to explicitly parse the env values
(e.g. check process.env.CI and process.env.NEMOCLAW_RUN_INSTALLER_TESTS against
'1' or 'true' case-insensitively, or use a small helper like isTruthyEnv(var)
that returns (val && ['1','true'].includes(val.toLowerCase())) ) and use that
helper or explicit comparisons in the enabled assignment so only explicit
true-ish values enable installer tests.
🪄 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: de1898b3-e142-45e0-8ae6-5c03cd8a7c3f
📒 Files selected for processing (3)
test/install-openshell-version-check.test.tstest/install-preflight.test.tsvitest.config.ts
✅ Files skipped from review due to trivial changes (2)
- test/install-preflight.test.ts
- test/install-openshell-version-check.test.ts
CI=0 or CI=false should not enable the installer-integration project. Check against '1' and 'true' explicitly.
…NVIDIA#2435) ## Summary Tests in `install-preflight.test.ts` and `install-openshell-version-check.test.ts` flake persistently under the default 5s vitest timeout. Each test spawns `bash install.sh` — these are integration tests, not unit tests, and belong in CI. ## Changes - Set `{ timeout: 15_000 }` on the `describe` block in both test files (keeps them passing when run explicitly) - Add a new `installer-integration` vitest project enabled only by `CI=1` or `NEMOCLAW_RUN_INSTALLER_TESTS=1` - Exclude the two files from the `cli` project so pre-push hooks skip them Run explicitly: `npx vitest run --project installer-integration` ## Type of Change - [x] Code change (feature, bug fix, or refactor) ## Verification - [x] `npx prek run --all-files` passes - [x] Both test files pass: 65/65 tests - [x] No secrets, API keys, or credentials committed --- Signed-off-by: Aaron Erickson <aerickson@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Added explicit 15s timeouts to installer test suites to reduce flaky runs. * Moved installer-specific tests into a separate CI-gated project so they run only in CI or when explicitly enabled, keeping regular test runs lean. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…NVIDIA#2435) ## Summary Tests in `install-preflight.test.ts` and `install-openshell-version-check.test.ts` flake persistently under the default 5s vitest timeout. Each test spawns `bash install.sh` — these are integration tests, not unit tests, and belong in CI. ## Changes - Set `{ timeout: 15_000 }` on the `describe` block in both test files (keeps them passing when run explicitly) - Add a new `installer-integration` vitest project enabled only by `CI=1` or `NEMOCLAW_RUN_INSTALLER_TESTS=1` - Exclude the two files from the `cli` project so pre-push hooks skip them Run explicitly: `npx vitest run --project installer-integration` ## Type of Change - [x] Code change (feature, bug fix, or refactor) ## Verification - [x] `npx prek run --all-files` passes - [x] Both test files pass: 65/65 tests - [x] No secrets, API keys, or credentials committed --- Signed-off-by: Aaron Erickson <aerickson@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Added explicit 15s timeouts to installer test suites to reduce flaky runs. * Moved installer-specific tests into a separate CI-gated project so they run only in CI or when explicitly enabled, keeping regular test runs lean. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Tests in
install-preflight.test.tsandinstall-openshell-version-check.test.tsflake persistently under the default 5s vitest timeout. Each test spawnsbash install.sh— these are integration tests, not unit tests, and belong in CI.Changes
{ timeout: 15_000 }on thedescribeblock in both test files (keeps them passing when run explicitly)installer-integrationvitest project enabled only byCI=1orNEMOCLAW_RUN_INSTALLER_TESTS=1cliproject so pre-push hooks skip themRun explicitly:
npx vitest run --project installer-integrationType of Change
Verification
npx prek run --all-filespassesSigned-off-by: Aaron Erickson aerickson@nvidia.com
Summary by CodeRabbit