Skip to content

test: add shouldPatchCoredns WSL2 unit tests - #1274

Merged
cv merged 3 commits into
mainfrom
fix/wsl2-sandbox-dns-v2
Apr 1, 2026
Merged

test: add shouldPatchCoredns WSL2 unit tests#1274
cv merged 3 commits into
mainfrom
fix/wsl2-sandbox-dns-v2

Conversation

@jieunl24

@jieunl24 jieunl24 commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow up of #1207 to add unit tests

Changes

Add tests verifying CoreDNS patching is skipped on WSL2 and still applied on non-WSL runtimes. Existing tests updated to pass explicit platform opts so they work correctly when run from a WSL2 host.

Type of Change

  • Code change for a new feature, bug fix, or refactor.
  • Code change with doc updates.
  • Doc only. Prose changes without code sample modifications.
  • Doc only. Includes code sample changes.

Testing

  • npx prek run --all-files passes (or equivalently make check).
  • npm test passes.
  • make docs builds without warnings. (for doc-only changes)

Checklist

General

Code Changes

  • Formatters applied — npx prek run --all-files auto-fixes formatting (or make format for targeted runs).
  • Tests added or updated for new or changed behavior.
  • No secrets, API keys, or credentials committed.
  • Doc pages updated for any user-facing behavior changes (new commands, changed defaults, new features, bug fixes that contradict existing docs).

Doc Changes

  • Follows the style guide. Try running the update-docs agent skill to draft changes while complying with the style guide. For example, prompt your agent with "/update-docs catch up the docs for the new changes I made in this PR."
  • New pages include SPDX license header and frontmatter, if creating a new page.
  • Cross-references and links verified.

Summary by CodeRabbit

  • Tests
    • Improved platform runtime tests to pass full context options and validate behavior for specific known runtimes.
    • Added a coverage case ensuring WSL detection prevents the patch in the appropriate scenario.
    • Retained the existing test for skipping unknown runtimes.

Follow up of #1207
Add tests verifying CoreDNS patching is skipped on WSL2 and still
applied on non-WSL runtimes. Existing tests updated to pass explicit
platform opts so they work correctly when run from a WSL2 host.
@coderabbitai

coderabbitai Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

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: 645c28e2-188b-4436-8c14-808ef4010854

📥 Commits

Reviewing files that changed from the base of the PR and between 9b64a13 and 4f0da2d.

📒 Files selected for processing (1)
  • test/platform.test.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/platform.test.js

📝 Walkthrough

Walkthrough

Updated tests for shouldPatchCoredns to call the function with a full runtime/context options object and to assert behavior for known runtimes on darwin, and for docker-desktop when WSL is detected on linux.

Changes

Cohort / File(s) Summary
Test Suite Updates
test/platform.test.js
Rewrote shouldPatchCoredns tests to pass runtime options (platform, env, release). Assert true for colima, docker-desktop, docker, podman on platform: "darwin". Added test asserting docker-desktop returns false when WSL env/release indicates WSL on platform: "linux". The unknown-runtime test is unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 I hopped through tests with nimble feet,
Passing options made the checks complete.
Darwin runtimes sing in tune,
WSL hides the docker-desktop moon.
A tiny tweak — the suite's replete.

🚥 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 summarizes the main change: adding WSL2 unit tests for the shouldPatchCoredns function.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/wsl2-sandbox-dns-v2

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

@cv

cv commented Apr 1, 2026

Copy link
Copy Markdown
Collaborator

@jieunl24 can you look into the checks failures, please? looks like formatting.

@cv
cv merged commit 0658728 into main Apr 1, 2026
10 checks passed
laitingsheng pushed a commit that referenced this pull request Apr 2, 2026
<!-- markdownlint-disable MD041 -->
## Summary
Follow up of #1207 to add unit tests

## Changes
Add tests verifying CoreDNS patching is skipped on WSL2 and still
applied on non-WSL runtimes. Existing tests updated to pass explicit
platform opts so they work correctly when run from a WSL2 host.

## Type of Change
<!-- Check the one that applies. -->
- [ ] Code change for a new feature, bug fix, or refactor.
- [ ] Code change with doc updates.
- [ ] Doc only. Prose changes without code sample modifications.
- [ ] Doc only. Includes code sample changes.

## Testing
<!-- What testing was done? -->
- [X] `npx prek run --all-files` passes (or equivalently `make check`).
- [X] `npm test` passes.
- [ ] `make docs` builds without warnings. (for doc-only changes)

## Checklist

### General

- [X] I have read and followed the [contributing
guide](https://github.com/NVIDIA/NemoClaw/blob/main/CONTRIBUTING.md).
- [ ] I have read and followed the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md).
(for doc-only changes)

### Code Changes
<!-- Skip if this is a doc-only PR. -->
- [X] Formatters applied — `npx prek run --all-files` auto-fixes
formatting (or `make format` for targeted runs).
- [X] Tests added or updated for new or changed behavior.
- [X] No secrets, API keys, or credentials committed.
- [ ] Doc pages updated for any user-facing behavior changes (new
commands, changed defaults, new features, bug fixes that contradict
existing docs).

### Doc Changes
<!-- Skip if this PR has no doc changes. -->
- [ ] Follows the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md).
Try running the `update-docs` agent skill to draft changes while
complying with the style guide. For example, prompt your agent with
"`/update-docs` catch up the docs for the new changes I made in this
PR."
- [ ] New pages include SPDX license header and frontmatter, if creating
a new page.
- [ ] Cross-references and links verified.


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

* **Tests**
* Improved platform runtime tests to pass full context options and
validate behavior for specific known runtimes.
* Added a coverage case ensuring WSL detection prevents the patch in the
appropriate scenario.
  * Retained the existing test for skipping unknown runtimes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Carlos Villela <cvillela@nvidia.com>
@wscurran wscurran added the CI/CD label Apr 3, 2026
lakamsani pushed a commit to lakamsani/NemoClaw that referenced this pull request Apr 4, 2026
<!-- markdownlint-disable MD041 -->
## Summary
Follow up of NVIDIA#1207 to add unit tests

## Changes
Add tests verifying CoreDNS patching is skipped on WSL2 and still
applied on non-WSL runtimes. Existing tests updated to pass explicit
platform opts so they work correctly when run from a WSL2 host.

## Type of Change
<!-- Check the one that applies. -->
- [ ] Code change for a new feature, bug fix, or refactor.
- [ ] Code change with doc updates.
- [ ] Doc only. Prose changes without code sample modifications.
- [ ] Doc only. Includes code sample changes.

## Testing
<!-- What testing was done? -->
- [X] `npx prek run --all-files` passes (or equivalently `make check`).
- [X] `npm test` passes.
- [ ] `make docs` builds without warnings. (for doc-only changes)

## Checklist

### General

- [X] I have read and followed the [contributing
guide](https://github.com/NVIDIA/NemoClaw/blob/main/CONTRIBUTING.md).
- [ ] I have read and followed the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md).
(for doc-only changes)

### Code Changes
<!-- Skip if this is a doc-only PR. -->
- [X] Formatters applied — `npx prek run --all-files` auto-fixes
formatting (or `make format` for targeted runs).
- [X] Tests added or updated for new or changed behavior.
- [X] No secrets, API keys, or credentials committed.
- [ ] Doc pages updated for any user-facing behavior changes (new
commands, changed defaults, new features, bug fixes that contradict
existing docs).

### Doc Changes
<!-- Skip if this PR has no doc changes. -->
- [ ] Follows the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md).
Try running the `update-docs` agent skill to draft changes while
complying with the style guide. For example, prompt your agent with
"`/update-docs` catch up the docs for the new changes I made in this
PR."
- [ ] New pages include SPDX license header and frontmatter, if creating
a new page.
- [ ] Cross-references and links verified.


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

* **Tests**
* Improved platform runtime tests to pass full context options and
validate behavior for specific known runtimes.
* Added a coverage case ensuring WSL detection prevents the patch in the
appropriate scenario.
  * Retained the existing test for skipping unknown runtimes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Carlos Villela <cvillela@nvidia.com>
gemini2026 pushed a commit to gemini2026/NemoClaw that referenced this pull request Apr 14, 2026
<!-- markdownlint-disable MD041 -->
## Summary
Follow up of NVIDIA#1207 to add unit tests

## Changes
Add tests verifying CoreDNS patching is skipped on WSL2 and still
applied on non-WSL runtimes. Existing tests updated to pass explicit
platform opts so they work correctly when run from a WSL2 host.

## Type of Change
<!-- Check the one that applies. -->
- [ ] Code change for a new feature, bug fix, or refactor.
- [ ] Code change with doc updates.
- [ ] Doc only. Prose changes without code sample modifications.
- [ ] Doc only. Includes code sample changes.

## Testing
<!-- What testing was done? -->
- [X] `npx prek run --all-files` passes (or equivalently `make check`).
- [X] `npm test` passes.
- [ ] `make docs` builds without warnings. (for doc-only changes)

## Checklist

### General

- [X] I have read and followed the [contributing
guide](https://github.com/NVIDIA/NemoClaw/blob/main/CONTRIBUTING.md).
- [ ] I have read and followed the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md).
(for doc-only changes)

### Code Changes
<!-- Skip if this is a doc-only PR. -->
- [X] Formatters applied — `npx prek run --all-files` auto-fixes
formatting (or `make format` for targeted runs).
- [X] Tests added or updated for new or changed behavior.
- [X] No secrets, API keys, or credentials committed.
- [ ] Doc pages updated for any user-facing behavior changes (new
commands, changed defaults, new features, bug fixes that contradict
existing docs).

### Doc Changes
<!-- Skip if this PR has no doc changes. -->
- [ ] Follows the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md).
Try running the `update-docs` agent skill to draft changes while
complying with the style guide. For example, prompt your agent with
"`/update-docs` catch up the docs for the new changes I made in this
PR."
- [ ] New pages include SPDX license header and frontmatter, if creating
a new page.
- [ ] Cross-references and links verified.


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

* **Tests**
* Improved platform runtime tests to pass full context options and
validate behavior for specific known runtimes.
* Added a coverage case ensuring WSL detection prevents the patch in the
appropriate scenario.
  * Retained the existing test for skipping unknown runtimes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Carlos Villela <cvillela@nvidia.com>
@wscurran wscurran added area: ci CI workflows, checks, release automation, or GitHub Actions chore Build, CI, dependency, or tooling maintenance and removed CI/CD labels Jun 3, 2026
@cv
cv deleted the fix/wsl2-sandbox-dns-v2 branch June 28, 2026 00:22
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 chore Build, CI, dependency, or tooling maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants