Skip to content

test(e2e): add Vitest docs validation coverage#5185

Merged
cv merged 4 commits into
mainfrom
e2e-migrate/test-docs-validation-simple
Jun 11, 2026
Merged

test(e2e): add Vitest docs validation coverage#5185
cv merged 4 commits into
mainfrom
e2e-migrate/test-docs-validation-simple

Conversation

@jyaunches

@jyaunches jyaunches commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Add the simplest equivalent Vitest coverage for test/e2e/test-docs-validation.sh while keeping the legacy shell script in test/e2e for now.

Related Issues

Refs #5098
Refs #5138

Contract mapping

  • Legacy assertion: CLI/docs parity via check-docs.sh --only-cli
    • Replacement/bridge coverage: test/e2e-scenario/live/docs-validation.test.ts
    • Boundary preserved: real npm run build:cli, real bin/nemoclaw.js, real check-docs.sh
  • Legacy assertion: Markdown link validation with remote probes disabled in nightly
    • Replacement/bridge coverage: check-docs.sh --only-links --local-only from the Vitest test
    • Boundary preserved: real checkout-local markdown/link scanner
  • Legacy workflow lane: docs-validation-e2e in nightly-e2e.yaml
    • Replacement/bridge execution: same job name now runs targeted e2e-scenarios-live Vitest invocation
    • Legacy script file remains present in test/e2e/; deletion is deferred.

Simplicity check

  • Test shape: simple live Vitest test for checkout-local docs checks
  • New shared helpers: none
  • New framework/registry/ledger: none
  • Workflow changes: update existing nightly lane and existing workflow contract test only to run the Vitest bridge coverage
  • Legacy script deletion: none

Verification

  • npm run build:cli
  • NEMOCLAW_RUN_E2E_SCENARIOS=1 npx vitest run --project e2e-scenarios-live test/e2e-scenario/live/docs-validation.test.ts --silent=false --reporter=default
  • npx vitest run --project cli test/e2e-script-workflow.test.ts --silent=false --reporter=default
  • npm run typecheck:cli
  • npm run test-size:check -- test/e2e-scenario/live/docs-validation.test.ts test/e2e-script-workflow.test.ts
  • git diff --check

Summary by CodeRabbit

  • Tests

    • Migrated documentation validation testing to use modern testing framework
    • Enhanced artifact retention and management for validation results
  • Chores

    • Updated CI/CD workflow for improved documentation and CLI consistency checks

@copy-pr-bot

copy-pr-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 51fb7069-9572-41b4-98dd-101a617eb87d

📥 Commits

Reviewing files that changed from the base of the PR and between 38fea6f and 0d05bd0.

📒 Files selected for processing (1)
  • test/e2e-script-workflow.test.ts

📝 Walkthrough

Walkthrough

The PR migrates E2E docs validation from a legacy bash script to a Vitest-based scenario. The new Vitest test builds the CLI, validates no stale outputs, creates an isolated environment with a nemoclaw shim, and runs docs checks in two phases. The nightly CI workflow is refactored to execute the Vitest test and upload artifacts. The test expectations are updated to remove the legacy script from the allowlist and verify the new Vitest-driven flow.

Changes

Docs E2E Vitest Migration

Layer / File(s) Summary
E2E docs validation Vitest scenario
test/e2e-scenario/live/docs-validation.test.ts
New test file with constants, nemoclaw shim creation, directory walking and stale artifact helpers, and a complete E2E scenario that builds the CLI, validates no stale outputs, sets up isolated HOME/PATH with the shim, and runs docs checks in CLI-parity and local-link-validation phases with exit code and log assertions.
Nightly workflow refactor for docs validation
.github/workflows/nightly-e2e.yaml
docs-validation-e2e job adds job-level permissions, replaces Docker Hub auth + script execution with Node.js setup and npx vitest run command, and uploads Vitest artifacts. Docker Hub auth anchor is inlined into openclaw-tui-chat-correlation-e2e job to remove the shared anchor dependency.
E2E workflow test expectations update
test/e2e-script-workflow.test.ts
Node fs import updated to include readFileSync. Legacy test/e2e/test-docs-validation.sh removed from nightly-script allowlist. Docker Hub auth assertions extended. New test case verifies docs-validation-e2e job runs npx vitest with correct environment variables, uploads expected artifacts, and does not invoke the legacy bash script.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#5153: Both PRs modify the shared test/e2e-script-workflow.test.ts legacy shell allowlist (retiring different test/e2e/test-*.sh scripts) as part of migrating legacy E2E coverage to Vitest-driven checks.

Suggested labels

area: e2e, area: ci, chore

Suggested reviewers

  • cv
  • prekshivyas

Poem

🐰 From bash scripts to Vitest we hop,
E2E validation won't stop!
With shims and scenarios in place,
Docs checks now run at lightning pace,
The nightly CI journey's on top! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'test(e2e): add Vitest docs validation coverage' accurately captures the main change: migrating docs validation to Vitest testing framework and adding corresponding test coverage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch e2e-migrate/test-docs-validation-simple

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

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: docs-validation-e2e
Optional E2E: openclaw-tui-chat-correlation-e2e

Dispatch hint: docs-validation-e2e

Auto-dispatched E2E: docs-validation-e2e via nightly-e2e.yaml at 66a3de649db09957e81f4fae016005a72d73c78enightly run

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • docs-validation-e2e (low): This PR directly rewires the existing docs-validation-e2e job from the legacy shell script to the new Vitest scenario, so the migrated job should be run to verify the workflow command, gating env, npm dependency path, CLI build/parity checks, local link checks, and artifact upload all work together.

Optional E2E

  • openclaw-tui-chat-correlation-e2e (high): Optional confidence check for the first direct nightly job after the Docker Hub auth anchor was relocated from docs-validation-e2e; useful if maintainers want to prove the re-anchored auth step still expands correctly in a real downstream direct E2E job.

New E2E recommendations

  • None.

Dispatch hint

  • Workflow: .github/workflows/nightly-e2e.yaml
  • jobs input: docs-validation-e2e

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Recommendation

Required Vitest E2E scenarios: e2e-scenarios-all
Optional Vitest E2E scenarios: None

Dispatch required Vitest E2E scenarios:

  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref>

Workflow run

Full Vitest E2E advisor summary

Vitest E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: medium

Required Vitest E2E scenarios

  • e2e-scenarios-all: The PR adds a new live Vitest E2E test under test/e2e-scenario/live and rewires docs validation to invoke that Vitest coverage from nightly. There is no trusted-main live-supported typed scenario ID that directly targets this new docs-validation surface, so use the allowed all-scenarios fan-out rather than inventing a targeted ID.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref>

Optional Vitest E2E scenarios

  • None.

Relevant changed files

  • .github/workflows/nightly-e2e.yaml
  • test/e2e-scenario/live/docs-validation.test.ts

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor

Findings: 0 needs attention, 0 worth checking, 0 nice ideas
Since last review: 0 prior items resolved, 0 still apply, 0 new items found

Consider writing more tests for
  • **Runtime validation** — Validate the `docs-validation-e2e` workflow lane with a target-ref checkout runs `setup-node`, `npm ci --ignore-scripts`, `npm run build:cli`, the `e2e-scenarios-live` docs-validation scenario, and artifact upload without DockerHub or NVIDIA secrets.. Structural workflow tests and the migrated Vitest scenario cover the contract, but the PR changes the actual GitHub Actions setup and artifact path for a workflow lane.
  • **Acceptance clause:** Refs Epic: Migrate legacy bash E2E into the Vitest E2E system #5098 / Refs test(e2e): migrate docs validation to Vitest #5138 — add test evidence or identify existing coverage. No trusted linked issue clauses or issue comments were provided in deterministic context, so issue-level acceptance cannot be mapped beyond the PR-body contract above.

Workflow run details

This is an automated advisory review. A human maintainer must make the final merge decision.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
test/e2e-script-workflow.test.ts (1)

308-340: ⚡ Quick win

Assert the remaining docs-validation workflow contract fields.

This test should also pin job.permissions.contents and upload artifact with.name to prevent silent nightly contract drift.

Suggested patch
   it("runs docs validation directly through Vitest artifacts", () => {
     const job = nightlyWorkflow.jobs["docs-validation-e2e"];
@@
     const uploadStep = job.steps?.find((step) => step.name === "Upload docs validation artifacts");
 
+    expect(job.permissions?.contents).toBe("read");
@@
     expect(uploadStep?.if).toBe("always()");
+    expect(uploadStep?.with?.name).toBe("docs-validation-artifacts");
     expect(uploadStep?.with?.path).toBe("e2e-artifacts/vitest/docs-validation/");

As per coding guidelines, docs-validation-e2e must keep permissions: contents: read and artifact name: docs-validation-artifacts in the nightly contract.

🤖 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/e2e-script-workflow.test.ts` around lines 308 - 340, The test is missing
assertions that pin the docs-validation-e2e job permissions and artifact name;
update the "runs docs validation directly through Vitest artifacts" case to
assert that nightlyWorkflow.jobs["docs-validation-e2e"].permissions?.contents
=== "read" and that the upload step (uploadStep?.with?.name) ===
"docs-validation-artifacts" so the contract enforces permissions.contents: read
and the artifact name.

Source: Coding guidelines

🤖 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.

Nitpick comments:
In `@test/e2e-script-workflow.test.ts`:
- Around line 308-340: The test is missing assertions that pin the
docs-validation-e2e job permissions and artifact name; update the "runs docs
validation directly through Vitest artifacts" case to assert that
nightlyWorkflow.jobs["docs-validation-e2e"].permissions?.contents === "read" and
that the upload step (uploadStep?.with?.name) === "docs-validation-artifacts" so
the contract enforces permissions.contents: read and the artifact name.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 76b55b65-cd0c-4ef4-8807-a2dc93409608

📥 Commits

Reviewing files that changed from the base of the PR and between 0f99ee5 and 38fea6f.

📒 Files selected for processing (4)
  • .github/workflows/nightly-e2e.yaml
  • test/e2e-scenario/live/docs-validation.test.ts
  • test/e2e-script-workflow.test.ts
  • test/e2e/test-docs-validation.sh
💤 Files with no reviewable changes (1)
  • test/e2e/test-docs-validation.sh

@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ❌ Some jobs failed

Run: 27315511808
Target ref: 38fea6f74117c137688330f44deca0b6c96ee012
Workflow ref: main
Requested jobs: docs-validation-e2e
Summary: 0 passed, 1 failed, 0 skipped

Job Result
docs-validation-e2e ❌ failure

Failed jobs: docs-validation-e2e. Check run artifacts for logs.

@jyaunches jyaunches changed the title test(e2e): migrate docs validation to Vitest test(e2e): add Vitest docs validation coverage Jun 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 27316666885
Target ref: 0d05bd07c1226e612c5615ab74b0e5e66d4e0587
Workflow ref: main
Requested jobs: docs-validation-e2e
Summary: 0 passed, 0 failed, 0 skipped

Job Result
docs-validation-e2e ⚠️ cancelled

@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 27316804504
Target ref: 66a3de649db09957e81f4fae016005a72d73c78e
Workflow ref: main
Requested jobs: docs-validation-e2e
Summary: 1 passed, 0 failed, 0 skipped

Job Result
docs-validation-e2e ✅ success

@cv cv merged commit eaa29b5 into main Jun 11, 2026
36 checks passed
@cv cv deleted the e2e-migrate/test-docs-validation-simple branch June 11, 2026 05:15
@cv cv added the v0.0.64 Release target label Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v0.0.64 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants