Skip to content

ci(hooks): add root-level vitest to pre-push hooks#1083

Merged
cv merged 1 commit intomainfrom
fix/add-root-vitest-prepush
Mar 30, 2026
Merged

ci(hooks): add root-level vitest to pre-push hooks#1083
cv merged 1 commit intomainfrom
fix/add-root-vitest-prepush

Conversation

@ericksoa
Copy link
Copy Markdown
Contributor

@ericksoa ericksoa commented Mar 30, 2026

Summary

Root-level unit tests (test/*.test.js) were only caught by CI's test-unit job, never by local pre-push hooks. This meant test failures could be pushed and only discovered in CI.

Adds a vitest-root pre-push hook that runs npx vitest run --project cli when files in bin/, test/, or scripts/ change. Matches what CI's test-unit job runs.

Changes

.pre-commit-config.yaml — Add vitest-root hook at priority 20 (same as existing vitest-plugin), stage pre-push.

Summary by CodeRabbit

  • Chores
    • Enhanced development workflow by adding automated unit test validation during the push process for improved code quality assurance.

The pre-push hooks only ran vitest for the nemoclaw/ plugin project.
Root-level unit tests (test/*.test.js) were only caught by CI's
test-unit job, not locally. Add a vitest-root hook that runs
--project cli on pre-push so test failures are caught before push.
@ericksoa ericksoa added the CI/CD Use this label to identify issues with NemoClaw CI/CD pipeline or GitHub Actions. label Mar 30, 2026
@ericksoa ericksoa self-assigned this Mar 30, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6a197443-576a-467d-a413-81071e0c8c00

📥 Commits

Reviewing files that changed from the base of the PR and between 64fd127 and 42f3c9f.

📒 Files selected for processing (1)
  • .pre-commit-config.yaml

📝 Walkthrough

Walkthrough

A new pre-commit hook configuration for Vitest unit testing has been added to the pre-push stage. The hook executes npx vitest run --project cli on files matching the bin|test|scripts directories, with pass_filenames: false and priority 20.

Changes

Cohort / File(s) Summary
Pre-commit Hook Configuration
.pre-commit-config.yaml
Added vitest-root hook to pre-push stage that runs Vitest unit tests against the CLI project for files in bin, test, and scripts directories.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A test before we push with care,
Vitest hooks float through the air,
Pre-commit checks both swift and keen,
Keep our code pristine and clean!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a root-level vitest hook to pre-push hooks. It directly relates to the changeset's primary objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/add-root-vitest-prepush

Comment @coderabbitai help to get the list of available commands and usage tips.

@cv cv merged commit f59f58e into main Mar 30, 2026
10 checks passed
@cv cv deleted the fix/add-root-vitest-prepush branch March 30, 2026 05:06
brentrockwood added a commit to brentrockwood/NemoClaw that referenced this pull request Mar 30, 2026
log show --last 5m is slow on macOS (~3s), making debug --quick
exceed vitest's 5000ms default timeout. Kernel messages (log show /
dmesg) are not minimal diagnostics — gate them under QUICK=false.

Also add { timeout: 30000 } to the cli.test.js debug --quick test
as a safety net for any remaining slow commands on slower machines.

Fixes the vitest-root pre-push gate introduced in NVIDIA#1083.
laitingsheng pushed a commit that referenced this pull request Apr 2, 2026
The pre-push hooks only ran vitest for the nemoclaw/ plugin project.
Root-level unit tests (test/*.test.js) were only caught by CI's
test-unit job, not locally. Add a vitest-root hook that runs
--project cli on pre-push so test failures are caught before push.
lakamsani pushed a commit to lakamsani/NemoClaw that referenced this pull request Apr 4, 2026
The pre-push hooks only ran vitest for the nemoclaw/ plugin project.
Root-level unit tests (test/*.test.js) were only caught by CI's
test-unit job, not locally. Add a vitest-root hook that runs
--project cli on pre-push so test failures are caught before push.
brentrockwood added a commit to brentrockwood/NemoClaw that referenced this pull request Apr 7, 2026
log show --last 5m is slow on macOS (~3s), making debug --quick
exceed vitest's 5000ms default timeout. Kernel messages (log show /
dmesg) are not minimal diagnostics — gate them under QUICK=false.

Also add { timeout: 30000 } to the cli.test.js debug --quick test
as a safety net for any remaining slow commands on slower machines.

Fixes the vitest-root pre-push gate introduced in NVIDIA#1083.
gemini2026 pushed a commit to gemini2026/NemoClaw that referenced this pull request Apr 14, 2026
The pre-push hooks only ran vitest for the nemoclaw/ plugin project.
Root-level unit tests (test/*.test.js) were only caught by CI's
test-unit job, not locally. Add a vitest-root hook that runs
--project cli on pre-push so test failures are caught before push.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD Use this label to identify issues with NemoClaw CI/CD pipeline or GitHub Actions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants