[Test Coverage] src/docker-manager.ts - #6795
Conversation
Adds unit tests verifying docker-manager.ts re-exports match the underlying implementations from host-env, config-writer, container-lifecycle, and container-cleanup, plus functional tests exercising parseDifcProxyHost and cleanup through the barrel. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds barrel-module tests for docker-manager.ts.
Changes:
- Verifies re-export identity.
- Exercises proxy parsing and cleanup paths.
- Introduces substantial overlap with existing test suites.
Show a summary per file
| File | Description |
|---|---|
src/docker-manager.test.ts |
Adds re-export and runtime tests for the Docker manager barrel. |
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
| * Tests for the docker-manager.ts barrel/re-export module. | ||
| * | ||
| * docker-manager.ts itself contains no logic beyond re-exporting symbols from | ||
| * host-env, config-writer, container-lifecycle, and container-cleanup. These |
| it('returns without throwing when the work directory does not exist', async () => { | ||
| await expect( | ||
| dockerManager.cleanup('/tmp/awf-does-not-exist-xyz', false), | ||
| ).resolves.toBeUndefined(); | ||
| }); |
|
@copilot address review feedback |
Removed |
|
✅ Copilot review passed with no inline comments. @github-actions[bot] Add the |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
✅ Contribution Check completed successfully! Contribution check complete for PR #6795: no guideline issues found in the provided context. The change adds a colocated test under src/ and includes its own test coverage; no documentation or file-organization concerns are apparent from CONTRIBUTING.md. |
|
✅ Smoke Gemini completed. All facets verified. 💎 |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🔌 Smoke Services — All services reachable! ✅ |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅ |
|
📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤 |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
|
✅ Smoke Claude passed |
|
🚀 Security Guard has started processing this pull request |
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
✅ Build Test Suite completed successfully! |
Smoke Test: Copilot BYOK (Direct) Mode ✅ PASSTest Results:
Mode: Direct BYOK (COPILOT_PROVIDER_API_KEY via api-proxy) CC
|
Smoke Test: Claude Engine Validation
Overall result: PASS
|
|
EGRESS_RESULT allow=pass deny=pass ✅ Allowed domain (github.com) reachable — Overall: PASS cc 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
Overall: FAIL —
|
|
Smoke Test: Copilot Engine —
Overall: PASS
|
Chroot Version Comparison
Overall: FAILED — Node.js version differs between host and chroot environment (v24.18.0 vs v22.23.1). Python and Go versions match.
|
Smoke Test
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
- "registry.npmjs.org"See Network Configuration for more information.
|
Gemini Engine Validation Results
Overall status: FAIL
|
Smoke Test: API Proxy OTEL Tracing — Results
Overall: All checked scenarios pass. No unexpected failures detected.
|
|
Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) authenticated via Microsoft Entra Overall: PASS
|
|
Smoke Test Results:
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) Overall: FAIL
|
🏗️ Build Test Suite Results
Overall: 7/8 ecosystems passed — FAIL ❌ Java Failure DetailsBoth Root cause:
|
|
Smoke Test: Docker Sbx Validation —
Overall: PASS
|
Summary
Adds
src/docker-manager.test.tsto cover thedocker-manager.tsbarrel/re-export module, which previously had 18% statement coverage largely because the barrel file itself had no dedicated test file.docker-manager.tscontains no logic of its own — it re-exports symbols fromhost-env,config-writer,container-lifecycle, andcontainer-cleanup. The new tests:setAwfDockerHost,getLocalDockerEnv,parseDifcProxyHost,writeConfigs,startContainers,runAgentCommand,fastKillAgentContainer,collectDiagnosticLogs,stopContainers,preserveIptablesAudit,cleanup) is identical (toBe) to the underlying implementation, following the style of the existingdocker-manager-reexports.test.ts.parseDifcProxyHostthrough the barrel with normal input, empty input (default host/port), and IPv6 bracketed notation.cleanupthrough the barrel for thekeepFiles: trueearly-return path and the non-existent work-directory path, without touching Docker or the filesystem beyondfs.existsSyncchecks.execaandhost-env(UID/GID lookups) are mocked to avoid any real Docker or host calls, consistent with existing tests in this repo.Testing
All 9 new tests pass.