Skip to content

refactor(e2e): expose Docker prerequisites through Vitest fixtures - #6365

Merged
cv merged 2 commits into
NVIDIA:mainfrom
jyaunches:refactor/e2e-docker-prerequisite
Jul 7, 2026
Merged

refactor(e2e): expose Docker prerequisites through Vitest fixtures#6365
cv merged 2 commits into
NVIDIA:mainfrom
jyaunches:refactor/e2e-docker-prerequisite

Conversation

@jyaunches

@jyaunches jyaunches commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Expose the existing redacting Docker probe through the live Vitest fixture with explicit required, optional, and intentionally-missing policies.

Closes #6354
Parent epic: #6346

Changes

  • Add DockerPrerequisite with probeDocker, requireDocker, and expectMissingDocker.
  • Centralize local-skip versus CI-failure behavior for required Docker.
  • Expose the prerequisite as the docker E2E fixture.
  • Migrate the sandbox-operations prerequisite block.
  • Preserve isolated Docker config, redacted output, and artifacts through DockerProbe.
  • Add 9 focused prerequisite/probe tests.

Verification

  • Signed/Verified commit and all hooks passed
  • npm run build:cli
  • npm run typecheck:cli
  • Docker support tests: 9 passed
  • No product behavior, docs, or secrets changed

Signed-off-by: Julie Yaunches jyaunches@nvidia.com

Summary by CodeRabbit

  • Bug Fixes
    • Improved Docker availability checks for live test runs, with clearer handling when Docker is missing.
    • Tests now skip more gracefully on local machines and fail more explicitly in CI when Docker is unavailable.
    • Added coverage for Docker-present, Docker-missing, and expected-missing scenarios to make test behavior more reliable.

@coderabbitai

coderabbitai Bot commented Jul 7, 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: cbb23b9f-30aa-4c5f-a53b-5b7edb4e059c

📥 Commits

Reviewing files that changed from the base of the PR and between b435598 and 3acf8e1.

📒 Files selected for processing (4)
  • test/e2e/fixtures/docker-probe.ts
  • test/e2e/fixtures/e2e-test.ts
  • test/e2e/live/sandbox-operations.test.ts
  • test/e2e/support/e2e-docker-prerequisite.test.ts

📝 Walkthrough

Walkthrough

Adds a DockerPrerequisite class wrapping DockerProbe with probeDocker, requireDocker, and expectMissingDocker methods. Exposes it as a docker fixture in E2ETargetFixtures, migrates sandbox-operations.test.ts to use it, and adds a new support test suite.

Changes

Docker Prerequisite Fixture

Layer / File(s) Summary
DockerPrerequisite class
test/e2e/fixtures/docker-probe.ts
Adds a DockerPrerequisite class with probeDocker, requireDocker (CI throws, local calls skip), and expectMissingDocker methods; reorders node:child_process imports.
Fixture exposure
test/e2e/fixtures/e2e-test.ts
Adds docker to E2ETargetFixtures, constructs DockerProbe with artifacts/redaction, and yields DockerPrerequisite from base.extend.
Live test migration
test/e2e/live/sandbox-operations.test.ts
Replaces manual docker info check and skip logic with await docker.requireDocker().
Support test suite
test/e2e/support/e2e-docker-prerequisite.test.ts
Adds tests for available/unavailable Docker and expectMissingDocker behavior with a temp-artifacts helper.

Estimated code review effort: 2 (Simple) | ~12 minutes

Sequence Diagram(s)

sequenceDiagram
    participant Test as sandbox-operations.test.ts
    participant Fixture as E2ETestFixtures
    participant Prereq as DockerPrerequisite
    participant Probe as DockerProbe

    Test->>Fixture: request docker fixture
    Fixture->>Probe: new DockerProbe(artifacts, redact)
    Fixture->>Prereq: new DockerPrerequisite(probe, skip)
    Fixture-->>Test: docker fixture
    Test->>Prereq: requireDocker()
    Prereq->>Probe: run(["info"])
    Probe-->>Prereq: DockerCommandResult
    alt exitCode === 0
        Prereq-->>Test: resolved (Docker available)
    else exitCode !== 0
        alt isCi
            Prereq-->>Test: throw error
        else
            Prereq->>Test: skip(reason)
        end
    end
Loading

Possibly related issues

Suggested labels: refactor

Suggested reviewers: ericksoa

🚥 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 title clearly summarizes the main change: exposing Docker prerequisites through Vitest fixtures for E2E tests.
Linked Issues check ✅ Passed The changes match the issue goals by adding a Docker prerequisite fixture, centralizing policy, migrating a live test, and adding support tests.
Out of Scope Changes check ✅ Passed No unrelated code changes are evident; the edits stay within the Docker prerequisite fixture refactor and its supporting tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maintainer review: the Docker prerequisite fixture exposes the existing availability contract without changing skip/failure semantics, with focused fixture and target coverage. Current-main synchronization cleared the stale growth failure; all exact-head checks, DCO, signatures, and review threads are clean.

@cv
cv merged commit c3b5285 into NVIDIA:main Jul 7, 2026
37 checks passed
@wscurran wscurran added area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery refactor PR restructures code without intended behavior change labels Jul 7, 2026
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
…VIDIA#6365)

## Summary

Expose the existing redacting Docker probe through the live Vitest
fixture with explicit required, optional, and intentionally-missing
policies.

Closes NVIDIA#6354
Parent epic: NVIDIA#6346

## Changes

- Add `DockerPrerequisite` with `probeDocker`, `requireDocker`, and
`expectMissingDocker`.
- Centralize local-skip versus CI-failure behavior for required Docker.
- Expose the prerequisite as the `docker` E2E fixture.
- Migrate the sandbox-operations prerequisite block.
- Preserve isolated Docker config, redacted output, and artifacts
through `DockerProbe`.
- Add 9 focused prerequisite/probe tests.

## Verification

- [x] Signed/Verified commit and all hooks passed
- [x] `npm run build:cli`
- [x] `npm run typecheck:cli`
- [x] Docker support tests: 9 passed
- [x] No product behavior, docs, or secrets changed

---
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved Docker availability checks for live test runs, with clearer
handling when Docker is missing.
* Tests now skip more gracefully on local machines and fail more
explicitly in CI when Docker is unavailable.
* Added coverage for Docker-present, Docker-missing, and
expected-missing scenarios to make test behavior more reliable.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery refactor PR restructures code without intended behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(e2e): expose Docker prerequisites through Vitest fixtures

3 participants