[Test Coverage] src/docker-manager.ts - #6916
Conversation
Covers subnetsOverlap, stripScheme, and parseDifcProxyHost including edge cases: empty/whitespace input, invalid ports, IPv6 notation, scheme stripping, and malformed URL fallback paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds tests for host-env.ts helpers, but substantially duplicates existing suites.
Changes:
- Tests subnet overlap detection.
- Tests URL hostname normalization.
- Tests DIFC proxy host parsing and validation.
Show a summary per file
| File | Description |
|---|---|
src/host-env.test.ts |
Adds unit tests for host environment helpers. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Balanced
| // stripScheme, and parseDifcProxyHost. These are re-exported (in part) via | ||
| // the docker-manager.ts barrel module. | ||
|
|
||
| import { stripScheme, parseDifcProxyHost, hostEnvTestHelpers } from './host-env'; |
| // Tests for host-env.ts pure helper functions: subnetsOverlap (internal), | ||
| // stripScheme, and parseDifcProxyHost. These are re-exported (in part) via | ||
| // the docker-manager.ts barrel module. |
|
@copilot address review feedback |
|
📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅ |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
✅ Smoke Claude passed |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🔌 Smoke Services — All services reachable! ✅ |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Smoke Gemini completed. All facets verified. 💎 |
|
✅ Contribution Check completed successfully! No contribution-guideline issues found in PR #6916. The PR adds a focused test suite in the correct source/test location, includes testing notes in the description, and does not introduce documentation or organization concerns under CONTRIBUTING.md. |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
🚀 Security Guard has started processing this pull request |
|
✅ Build Test Suite completed successfully! |
This comment has been minimized.
This comment has been minimized.
|
✅ Smoke Gemini completed. All facets verified. 💎 |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
✅ Build Test Suite completed successfully! |
|
✅ Smoke Claude passed |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🔌 Smoke Services — All services reachable! ✅ |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
|
📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤 |
Smoke Test: Copilot BYOK (Direct) Mode ✅Test Results:
Mode: Direct BYOK ( Overall Status: PASS
|
|
EGRESS_RESULT allow=pass deny=pass ✅ Allowed domain (api.github.com) reachable — Overall: PASS
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
|
Smoke Test Results (Copilot Engine)
Overall: PASS
|
Smoke Test: Claude Engine Validation
Overall result: PASS
|
Smoke Test: Services Connectivity
Overall: FAIL —
|
Gemini Smoke Test Results
Overall Status: FAIL
|
Chroot Version Comparison
Overall: FAILED — Node.js version mismatch between host and chroot environments.
|
📡 OTel Tracing Smoke Test Results
Overall: All 5 scenarios passed. No regressions detected in OTEL tracing integration.
|
|
|
|
Smoke test results:
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — PASS Note: Java Maven builds initially failed with a
|
|
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) PASS
|
Smoke Test: Docker Sbx Validation
Overall: PASS cc PR author/assignees
|
Summary
Adds unit tests for
src/host-env.ts, one of the modules re-exported by thesrc/docker-manager.tsbarrel (target file:docker-manager.ts, currently ~18% covered).docker-manager.tsitself is only a re-export barrel with dedicated per-module test suites; this PR adds the missing suite forhost-env.ts, which previously had no direct test file.What's covered
hostEnvTestHelpers.subnetsOverlap(internal CIDR overlap helper): identical subnets, overlapping subnets with differing masks, disjoint subnets, adjacent-but-non-overlapping subnets, fully-contained subnets.stripScheme: empty/whitespace input, scheme+path stripping, implicit scheme for bare hostnames, query/fragment stripping, credentials+port stripping, whitespace trimming, and the catch-fallback path for unparsable input.parseDifcProxyHost: default host/port for empty/whitespace input, plainhost:port, default port when omitted, IPv6 bracketed notation, scheme-prefix stripping, invalid/malformed value error path, port-zero validation error path, and whitespace trimming.Testing
Ran the new suite in isolation:
All 22 tests pass (
src/host-env.test.ts). No existing tests were modified.