Skip to content

[Test Coverage] src/docker-manager.ts - #6795

Merged
lpcox merged 2 commits into
mainfrom
test-coverage/docker-manager-barrel-4ca19695f1d2e294
Jul 31, 2026
Merged

[Test Coverage] src/docker-manager.ts#6795
lpcox merged 2 commits into
mainfrom
test-coverage/docker-manager-barrel-4ca19695f1d2e294

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Adds src/docker-manager.test.ts to cover the docker-manager.ts barrel/re-export module, which previously had 18% statement coverage largely because the barrel file itself had no dedicated test file.

docker-manager.ts contains no logic of its own — it re-exports symbols from host-env, config-writer, container-lifecycle, and container-cleanup. The new tests:

  • Verify each re-exported binding (setAwfDockerHost, getLocalDockerEnv, parseDifcProxyHost, writeConfigs, startContainers, runAgentCommand, fastKillAgentContainer, collectDiagnosticLogs, stopContainers, preserveIptablesAudit, cleanup) is identical (toBe) to the underlying implementation, following the style of the existing docker-manager-reexports.test.ts.
  • Exercise parseDifcProxyHost through the barrel with normal input, empty input (default host/port), and IPv6 bracketed notation.
  • Exercise cleanup through the barrel for the keepFiles: true early-return path and the non-existent work-directory path, without touching Docker or the filesystem beyond fs.existsSync checks.

execa and host-env (UID/GID lookups) are mocked to avoid any real Docker or host calls, consistent with existing tests in this repo.

Testing

./node_modules/.bin/jest --testPathPatterns="^src/docker-manager\.test\.ts$" --no-coverage

All 9 new tests pass.

Generated by Test Coverage Improver · aut00 · 38.6 AIC · ⊞ 9K ·

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>
@lpcox
lpcox marked this pull request as ready for review July 31, 2026 13:39
Copilot AI review requested due to automatic review settings July 31, 2026 13:39

Copilot AI 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.

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

Comment thread src/docker-manager.test.ts Outdated
Comment on lines +2 to +5
* 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
Comment thread src/docker-manager.test.ts Outdated
Comment on lines +86 to +90
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();
});
@lpcox

lpcox commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Copilot AI commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@copilot address review feedback

Removed src/docker-manager.test.ts in 35ec86a. All the coverage it added is already present in the existing specialized suites (docker-manager-reexports.test.ts, docker-manager-host-config.test.ts, docker-manager-cleanup.test.ts) — the hardcoded /tmp path concern is moot with the file gone. 39 existing tests continue to pass.

Copilot finished work on behalf of lpcox July 31, 2026 14:03
Copilot AI requested a review from lpcox July 31, 2026 14:03
@github-actions

Copy link
Copy Markdown
Contributor Author

✅ Copilot review passed with no inline comments.

@github-actions[bot] Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

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.

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Gemini completed. All facets verified. 💎

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Claude passed

@github-actions

Copy link
Copy Markdown
Contributor Author

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Build Test Suite completed successfully!

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test: Copilot BYOK (Direct) Mode ✅ PASS

Test Results:

  • ✅ GitHub MCP Testing: PR data verified
  • ✅ GitHub.com Connectivity: HTTP 200
  • ✅ File Write/Read: Confirmed
  • ✅ BYOK Inference: Active (agent → api-proxy sidecar → api.githubcopilot.com)

Mode: Direct BYOK (COPILOT_PROVIDER_API_KEY via api-proxy)

CC @lpcox

🔑 BYOK report filed by Smoke Copilot BYOK
Add label ready-for-aw to run again

@github-actions github-actions Bot added smoke-copilot-byok smoke-copilot-network-isolation Copilot network-isolation egress smoke test labels Jul 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test: Claude Engine Validation

Check Result
API status ✅ PASS
GH check ✅ PASS
File status ✅ PASS

Overall result: PASS

Generated by Smoke Claude for #6795 · haiku45 · 54.9 AIC · ⊞ 3.6K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

EGRESS_RESULT allow=pass deny=pass

✅ Allowed domain (github.com) reachable — allowed=200
✅ Non-allowed domain (example.com) blocked — CONNECT tunnel 403

Overall: PASS

cc @lpcox

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • example.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "example.com"

See Network Configuration for more information.

🛡️ Egress verdict from Smoke Copilot Network Isolation
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test Results

  • Redis PING: ❌ (name resolution failure)
  • PostgreSQL pg_isready: ❌ (no response)
  • PostgreSQL SELECT 1: ❌ (name resolution failure)

Overall: FAILhost.docker.internal could not be resolved from the sandbox.

🔌 Service connectivity validated by Smoke Services
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test: Copilot Engine@lpcox

Overall: PASS

📰 BREAKING: Report filed by Smoke Copilot
Add label ready-for-aw to run again

@github-actions github-actions Bot mentioned this pull request Jul 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor Author

Chroot Version Comparison

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.13 ✅ YES
Node.js v24.18.0 v22.23.1 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Overall: FAILED — Node.js version differs between host and chroot environment (v24.18.0 vs v22.23.1). Python and Go versions match.

Tested by Smoke Chroot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test

  • Upgrade gh-aw extension to latest pre-release
  • Validate bounded-query sandbox runtime matrix
  • Overall status: PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Gemini Engine Validation Results

Overall status: FAIL

💎 Faceted by Smoke Gemini
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test: API Proxy OTEL Tracing — Results

Scenario Result
1. Module Loading otel.js loads, exports startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled, plus exporter/parsing internals
2. Test Suite otel.test.js + otel-fanout.test.js: 59/59 passed
3. Env Var Forwarding ✅ OTEL vars (OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, GITHUB_AW_OTEL_TRACE_ID, GITHUB_AW_OTEL_PARENT_SPAN_ID, OTEL_SERVICE_NAME) are forwarded via src/services/api-proxy-env-config.ts (consumed by api-proxy-service.ts)
4. Token Tracker Integration onUsage callback present in token-tracker-http.js (invoked after usage normalization, hook point for OTEL)
5. OTEL Diagnostics i️ Not run in this session — no live proxy invocation performed, so no spans were exported (expected: this smoke test validated code paths, not a live run)

Overall: All checked scenarios pass. No unexpected failures detected.

📡 OTel tracing validated by Smoke OTel Tracing
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

@lpcox Smoke test results:
• GitHub MCP: ✅
• HTTP connectivity: ✅
• File I/O: ✅
• BYOK inference: ✅

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

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test Results:

  • GitHub MCP Testing: ❌ (MCP error)
  • GitHub.com Connectivity: ✅
  • File Write/Read Test: ✅
  • BYOK Inference Test: ✅

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)

Overall: FAIL

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A ✅ PASS
.NET json-parse N/A ✅ PASS
Go color 1/1 passed ✅ PASS
Go env 1/1 passed ✅ PASS
Go uuid 1/1 passed ✅ PASS
Java gson 0/0 ❌ FAIL
Java caffeine 0/0 ❌ FAIL
Node.js clsx pass ✅ PASS
Node.js execa pass ✅ PASS
Node.js p-limit pass ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 7/8 ecosystems passed — FAIL

❌ Java Failure Details

Both gson and caffeine failed at the mvn compile step with:

[ERROR] Could not create local repository at /home/runner/.m2/repository -> [Help 1]

Root cause: /home/runner/.m2 in this environment is owned by root:root (drwxr-xr-x), so the runner user cannot create the repository subdirectory under it. This is an environment/permissions issue in the CI sandbox, unrelated to the Squid proxy configuration (the ~/.m2/settings.xml proxy settings were applied and picked up correctly via JAVA_TOOL_OPTIONS/Maven proxy config). No firewall/network errors were observed — the failure occurred before any network access was attempted.

Generated by Build Test Suite for #6795 · aut00 · 36.8 AIC · ⊞ 11.3K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test: Docker Sbx Validation@lpcox

Overall: PASS

📰 BREAKING: Report filed by Smoke Docker Sbx
Add label ready-for-aw to run again

@lpcox
lpcox merged commit 73fb707 into main Jul 31, 2026
115 of 116 checks passed
@lpcox
lpcox deleted the test-coverage/docker-manager-barrel-4ca19695f1d2e294 branch July 31, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants