Skip to content

Align docker-manager tests with source-module import contract#3960

Merged
lpcox merged 3 commits into
mainfrom
copilot/export-audit-fix-imports
May 28, 2026
Merged

Align docker-manager tests with source-module import contract#3960
lpcox merged 3 commits into
mainfrom
copilot/export-audit-fix-imports

Conversation

Copilot AI commented May 28, 2026

Copy link
Copy Markdown
Contributor

Three docker-manager test files had reverted to importing via the docker-manager compatibility barrel, violating its explicit contract that tests import from source modules directly. This PR restores direct imports so tests target the owning modules instead of the public re-export surface.

  • Import contract restoration

    • src/docker-manager-utils.test.ts: parseDifcProxyHost now imports from ./host-env
    • src/docker-manager-cleanup.test.ts: writeConfigs now imports from ./config-writer; cleanup/diagnostic helpers from ./container-cleanup
    • src/docker-manager-lifecycle.test.ts: lifecycle ops import from ./container-lifecycle; docker host helpers from ./docker-host; stopContainers from ./container-cleanup
  • Layering clarity in tests

    • Removes coupling of unit tests to the backward-compatibility barrel (src/docker-manager.ts)
    • Makes module ownership explicit at call sites, reducing ambiguity during future refactors
// Before
import { parseDifcProxyHost } from './docker-manager';

// After
import { parseDifcProxyHost } from './host-env';

Copilot AI changed the title [WIP] Fix test files importing from docker-manager barrel Align docker-manager tests with source-module import contract May 28, 2026
Copilot AI requested a review from lpcox May 28, 2026 16:01
Copilot finished work on behalf of lpcox May 28, 2026 16:01
@lpcox lpcox marked this pull request as ready for review May 28, 2026 16:03
Copilot AI review requested due to automatic review settings May 28, 2026 16:03
@github-actions

github-actions Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 96.48% 96.62% 📈 +0.14%
Statements 96.35% 96.49% 📈 +0.14%
Functions 98.22% 98.22% ➡️ +0.00%
Branches 90.62% 90.78% 📈 +0.16%
📁 Per-file Coverage Changes (2 files)
File Lines (Before → After) Statements (Before → After)
src/config-writer.ts 89.3% → 90.9% (+1.65%) 89.3% → 90.9% (+1.65%)
src/cli-workflow.ts 88.9% → 100.0% (+11.12%) 88.9% → 100.0% (+11.12%)

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

@github-actions

This comment has been minimized.

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

This PR restores the test import layering contract by updating docker-manager-related unit tests to import directly from their owning source modules rather than the src/docker-manager.ts backwards-compatibility re-export barrel.

Changes:

  • Updated docker-manager-*.test.ts imports to reference host-env, config-writer, container-lifecycle, docker-host, and container-cleanup directly.
  • Reduced unit-test coupling to the public compatibility surface (./docker-manager) so refactors don’t force test churn.
Show a summary per file
File Description
src/docker-manager-utils.test.ts Imports parseDifcProxyHost from ./host-env instead of the compatibility barrel.
src/docker-manager-lifecycle.test.ts Splits lifecycle/host/cleanup imports to their owning modules.
src/docker-manager-cleanup.test.ts Imports writeConfigs from ./config-writer and cleanup/diagnostics from ./container-cleanup.

Copilot's findings

Tip

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

  • Files reviewed: 3/3 changed files
  • Comments generated: 2

Comment thread src/docker-manager-utils.test.ts Outdated
readEnvFile,
} from './github-env';
import { parseDifcProxyHost } from './docker-manager';
import { parseDifcProxyHost } from './host-env';
Comment thread src/docker-manager-lifecycle.test.ts Outdated
Comment on lines 1 to 4
import { startContainers, runAgentCommand, fastKillAgentContainer } from './container-lifecycle';
import { setAwfDockerHost, getLocalDockerEnv } from './docker-host';
import { stopContainers } from './container-cleanup';
import { containerLifecycleTestHelpers } from './container-lifecycle';
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@lpcox

lpcox commented May 28, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Copilot AI commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address review feedback

Addressed. I consolidated duplicate imports in both flagged test files in commit 3eabb62.

Copilot finished work on behalf of lpcox May 28, 2026 16:17
@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test (Claude) — ✅ PASS

  • ✅ GitHub API: 2 PR entries returned
  • ✅ GitHub check: playwright_check=PASS
  • ✅ File verify: smoke-test-claude-26587192062.txt present

Total: PASS

💥 [THE END] — Illustrated by Smoke Claude

@github-actions

Copy link
Copy Markdown
Contributor

🔥 Smoke Test: Copilot BYOK (Offline) Mode

Test Result
GitHub MCP (list PRs)
GitHub.com connectivity (HTTP 200)
File write/read (smoke-test-copilot-byok-26587192068.txt)
BYOK inference (agent → api-proxy → api.githubcopilot.com)

Running in BYOK offline mode (COPILOT_OFFLINE=true) via api-proxy → api.githubcopilot.com

PR: "Align docker-manager tests with source-module import contract" — author: @Copilot, assignees: @lpcox, @Copilot

Overall: PASS

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Smoke Test Results

Test Status
GitHub MCP (list PRs)
GitHub.com connectivity (HTTP 200)
File write/read (smoke-test-copilot-26587192012.txt)

Overall: PASS

PR: "Align docker-manager tests with source-module import contract" — author @Copilot, assignees @lpcox @Copilot

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Chroot Smoke Test Results

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

Result: ❌ Not all tests passed — Go matches but Python and Node.js versions differ between host and chroot.

Tested by Smoke Chroot

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results

Check Result
Redis PING (host.docker.internal:6379) ❌ connection timeout
PostgreSQL pg_isready (host.docker.internal:5432) ❌ no response
PostgreSQL SELECT 1 ❌ skipped (pg_isready failed)

Overall: FAIL — service containers are not reachable from this runner environment.

🔌 Service connectivity validated by Smoke Services

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results: FAIL (2/4 passed)

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

🏗️ 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 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 #3960 · sonnet46 1.1M ·

@lpcox lpcox merged commit a1692ae into main May 28, 2026
60 of 62 checks passed
@lpcox lpcox deleted the copilot/export-audit-fix-imports branch May 28, 2026 16:40
@github-actions

Copy link
Copy Markdown
Contributor

#3960 Align docker-manager tests with source-module import contract
#3945 [Test Coverage] Cover uncovered branches in cli-workflow runMainWorkflow
#3943 [docs] Document AWF_DIND env var and ARC/DinD sibling-socket auto-detection
GitHub PRs ✅
Safe inputs GH CLI ✅
Playwright ✅
File write ✅
Build ❌
Overall: FAIL

🔮 The oracle has spoken through Smoke Codex

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.

[Export Audit] Test files still import from docker-manager barrel instead of source modules

3 participants