Skip to content

[Test Coverage] deduplicate docker-manager.ts re-export tests#5341

Merged
lpcox merged 2 commits into
mainfrom
test-coverage/docker-manager-reexports-01d57f5cbb45820e
Jun 22, 2026
Merged

[Test Coverage] deduplicate docker-manager.ts re-export tests#5341
lpcox merged 2 commits into
mainfrom
test-coverage/docker-manager-reexports-01d57f5cbb45820e

Conversation

@github-actions

@github-actions github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Summary

docker-manager.ts is a backwards-compatibility facade that re-exports the public API from four underlying modules (host-env, config-writer, container-lifecycle, container-cleanup). The repository already had src/docker-manager-reexports.test.ts covering those re-exports, so the additional duplicate test file was unnecessary.

Changes

Removed the redundant src/docker-manager.test.ts and kept src/docker-manager-reexports.test.ts as the single source of truth for this contract.

The remaining test continues to verify all 11 re-exported symbols and still acts as a canary: if any export is accidentally removed or redirected to the wrong source the test will fail immediately.

Test results

PASS src/docker-manager-reexports.test.ts
  docker-manager re-exports
    host-env re-exports
      ✓ re-exports setAwfDockerHost
      ✓ re-exports getLocalDockerEnv
      ✓ re-exports parseDifcProxyHost
    config-writer re-exports
      ✓ re-exports writeConfigs
    container-lifecycle re-exports
      ✓ re-exports startContainers
      ✓ re-exports runAgentCommand
      ✓ re-exports fastKillAgentContainer
    container-cleanup re-exports
      ✓ re-exports collectDiagnosticLogs
      ✓ re-exports stopContainers
      ✓ re-exports preserveIptablesAudit
      ✓ re-exports cleanup

Tests: 11 passed, 11 total

> Generated by Test Coverage Improver · 108.5 AIC · ⊞ 5.9K ·

docker-manager.ts is a backwards-compatibility facade that re-exports
the public API from host-env, config-writer, container-lifecycle, and
container-cleanup. Because most test suites import directly from the
source modules, the re-export lines in docker-manager.ts were never
exercised (reported <20% coverage).

Add docker-manager.test.ts following the same pattern established by
host-iptables-reexports.test.ts: mock execa + logger, then assert
identity equality between each docker-manager export and its source.
This exercises all 11 re-export statements in the module and acts as
a canary for accidental re-export removal or mis-wiring.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lpcox lpcox marked this pull request as ready for review June 21, 2026 16:02
Copilot AI review requested due to automatic review settings June 21, 2026 16:02
@github-actions

Copy link
Copy Markdown
Contributor Author

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 97.85% 97.89% 📈 +0.04%
Statements 97.78% 97.82% 📈 +0.04%
Functions 99.50% 99.50% ➡️ +0.00%
Branches 93.55% 93.58% 📈 +0.03%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/workdir-setup.ts 92.7% → 94.5% (+1.82%) 92.7% → 94.5% (+1.82%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

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 a Jest unit test to exercise src/docker-manager.ts’s barrel re-exports so they count toward coverage and act as a canary against accidental export changes.

Changes:

  • Added src/docker-manager.test.ts that imports docker-manager and the underlying modules and asserts identity equality (toBe) for all re-exported symbols.
  • Mocks execa and logger using the shared test-helper factories to avoid side effects during module import.
Show a summary per file
File Description
src/docker-manager.test.ts New test verifying docker-manager.ts re-exports by asserting exported symbol identity equality against source modules.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment thread src/docker-manager.test.ts Outdated
Comment on lines +1 to +5
/**
* Verifies that docker-manager.ts correctly re-exports the runtime functions
* from the underlying modules it wraps (backwards-compatibility facade).
*
* The primary purpose of these tests is to exercise the re-export lines in
@github-actions

Copy link
Copy Markdown
Contributor Author

⏳ Copilot review left inline comments.

@github-actions[bot] To proceed:

  1. Ask @copilot to address the review feedback (reply to this comment or the review thread)
  2. Once the fix is pushed, add the ready-for-aw label to trigger agentic CI smoke tests

@lpcox

lpcox commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Copilot AI commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

@copilot address review feedback

Addressed in e9c31c9 by removing the redundant src/docker-manager.test.ts and keeping the existing src/docker-manager-reexports.test.ts as the single source of truth. Validated with npm test -- --runTestsByPath src/docker-manager-reexports.test.ts.

Copilot AI changed the title [Test Coverage] docker-manager.ts re-export coverage [Test Coverage] deduplicate docker-manager.ts re-export tests Jun 21, 2026
Copilot finished work on behalf of lpcox June 21, 2026 16:23
Copilot AI requested a review from lpcox June 21, 2026 16:23
@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Jun 21, 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 Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

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

@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Gemini completed. All facets verified. 💎

Testing safeoutputs

@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Build Test Suite completed successfully!

@github-actions

github-actions Bot commented Jun 21, 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 Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

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

@github-actions

github-actions Bot commented Jun 21, 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 Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Claude passed

@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅

@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

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

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test: Claude Engine

  • API status: ✅ PASS
  • gh check: ✅ PASS
  • File status: ✅ PASS

Overall result: PASS

Generated by Smoke Claude for issue #5341 · 60.6 AIC · ⊞ 3.1K ·

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test Results

Test Status
GitHub MCP connectivity ✅ PASS
GitHub.com HTTP connectivity ❌ FAIL (pre-step data not passed)
File write/read ❌ FAIL (pre-step data not passed)

Overall: FAIL — pre-computed smoke data (steps.smoke-data.outputs) was not substituted (template vars unresolved).

PR: [Test Coverage] deduplicate docker-manager.ts re-export tests
Author: @github-actions[bot] · Reviewer: @lpcox

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

Copy link
Copy Markdown
Contributor Author

perf(security-guard): prioritize security-relevant files in PR diff
fix(smoke-claude): raise turn budget to 8 and fix add_comment usage
GitHub reads: ✅
Playwright: ✅
File write/read: ✅
Discussion: ✅
Build: ✅
Overall: 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

@github-actions

Copy link
Copy Markdown
Contributor Author

🔍 Smoke Test: API Proxy OpenTelemetry Tracing

Scenario Result Notes
S1: Module Loading ✅ Pass otel.js loads; exports startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled
S2: Test Suite ✅ Pass otel.test.js: 39/39 tests passed (span creation, token attrs, GenAI conventions, exporters, shutdown)
S3: Env Var Forwarding ✅ Pass src/services/api-proxy-service-config.ts forwards GH_AW_OTLP_ENDPOINTS, OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, GITHUB_AW_OTEL_TRACE_ID, GITHUB_AW_OTEL_PARENT_SPAN_ID, OTEL_SERVICE_NAME to the api-proxy container
S4: Token Tracker Integration ✅ Pass onUsage callback exists in token-tracker-http.js (lines 283, 324, 374) as the OTEL hook point
S5: OTEL Diagnostics ✅ Pass FileSpanExporter writes spans to /var/log/api-proxy/otel.jsonl as local fallback when no OTLP endpoint is configured; graceful degradation confirmed

All scenarios passed. OTEL tracing integration is functional.

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test: Copilot BYOK (Direct Mode) — PASS

  1. ✅ GitHub MCP (PR list verified: PRs perf(security-guard): prioritize security-relevant files in PR diff #5329, fix(smoke-claude): raise turn budget to 8 and fix add_comment usage #5328)
  2. ✅ github.com connectivity (HTTP 200)
  3. ✅ File write/read test (created, read successfully)
  4. ✅ BYOK inference (direct mode active via api-proxy → api.githubcopilot.com)

Running in direct BYOK mode: COPILOT_PROVIDER_API_KEY forwarded to api-proxy sidecar, placeholder injected into agent.

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

Copy link
Copy Markdown
Contributor Author

🔥 Smoke Test: Copilot PAT Auth — PASS

Test Result
GitHub MCP connectivity
GitHub.com HTTP ✅ 200
File write/read

Overall: PASS · Auth mode: PAT (COPILOT_GITHUB_TOKEN)

PR by @github-actions, reviewer @lpcox

🔑 PAT report filed by Smoke Copilot PAT

@github-actions

Copy link
Copy Markdown
Contributor Author

Chroot Smoke Test Results ❌

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

Result: FAILED — Python and Node.js versions differ between host and chroot. Label smoke-chroot not applied.

Tested by Smoke Chroot

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test: Gemini Engine Validation

Overall status: FAIL

Warning

Firewall blocked 1 domain

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

  • localhost

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

network:
  allowed:
    - defaults
    - "localhost"

See Network Configuration for more information.

💎 Faceted by Smoke Gemini

@github-actions

Copy link
Copy Markdown
Contributor Author

@github-actions[bot] @lpcox

  • Split docker-manager cleanup tests by concern ✅
  • Split api-proxy token parser tests by JSON, SSE, and normalization concerns ✅
  • GitHub.com connectivity ✅
  • Agent file I/O smoke-test ✅
  • Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)
    Overall status: PASS

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)

@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 ok ✅ PASS
Go env ok ✅ PASS
Go uuid ok ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx all passed ✅ PASS
Node.js execa all passed ✅ PASS
Node.js p-limit all passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

Generated by Build Test Suite for issue #5341 · 43.8 AIC · ⊞ 7.7K ·

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test Results — Services Connectivity

Check Result
Redis PING ❌ Timeout (port 6379 closed)
PostgreSQL pg_isready ❌ No response (port 5432 closed)
PostgreSQL SELECT 1 ❌ Cannot connect

host.docker.internal resolves to 172.17.0.1 but both ports are unreachable from this runner.

Overall: FAIL

🔌 Service connectivity validated by Smoke Services

@github-actions

Copy link
Copy Markdown
Contributor Author

@github-actions[bot] @lpcox @Copilot

  1. GitHub MCP Testing: ✅
  2. GitHub.com Connectivity: ✅
  3. File Write/Read Test: ❌
  4. BYOK Inference Test: ✅
    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: FAIL

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)

@lpcox lpcox enabled auto-merge (squash) June 21, 2026 17:47
@lpcox lpcox disabled auto-merge June 22, 2026 03:16
@lpcox lpcox merged commit 73812f4 into main Jun 22, 2026
64 of 68 checks passed
@lpcox lpcox deleted the test-coverage/docker-manager-reexports-01d57f5cbb45820e branch June 22, 2026 03:16
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