Skip to content

refactor: fix test import path inconsistency for docker-manager#2975

Merged
lpcox merged 2 commits into
mainfrom
copilot/fix-import-path-inconsistency
May 12, 2026
Merged

refactor: fix test import path inconsistency for docker-manager#2975
lpcox merged 2 commits into
mainfrom
copilot/fix-import-path-inconsistency

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

Bug Fix

What was the bug?

Five src/services/* tests imported generateDockerCompose through ../docker-manager (a backward-compatibility barrel) while peer tests already imported directly from ../compose-generator. This created unnecessary API-surface inconsistency in the test suite.

How did you fix it?

  • Canonicalized import source in service tests
    • Updated these files to import generateDockerCompose from ../compose-generator:
      • src/services/agent-environment-credentials.test.ts
      • src/services/agent-volumes.test.ts
      • src/services/agent-environment-runtime.test.ts
      • src/services/agent-environment-proxy.test.ts
      • src/services/agent-environment-options.test.ts
  • Aligned test suite conventions
    • Service tests now consistently reference the canonical module rather than the compatibility barrel.
// Before
import { generateDockerCompose } from '../docker-manager';

// After
import { generateDockerCompose } from '../compose-generator';

Testing

Import-path-only change in tests; no production logic modified.

Copilot AI changed the title [WIP] Fix test import path inconsistency for docker-manager Normalize service test imports to canonical compose-generator module May 12, 2026
Copilot finished work on behalf of lpcox May 12, 2026 00:55
Copilot AI requested a review from lpcox May 12, 2026 00:55
@lpcox lpcox changed the title Normalize service test imports to canonical compose-generator module refactor: fix test import path inconsistency for docker-manager May 12, 2026
Copy link
Copy Markdown
Collaborator

@lpcox lpcox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean import path fix — changes 5 test files from docker-manager barrel to direct compose-generator import. Verified diff is surgical. Closes #2958.

@lpcox
Copy link
Copy Markdown
Collaborator

lpcox commented May 12, 2026

/copilot review

@lpcox lpcox closed this May 12, 2026
@lpcox lpcox reopened this May 12, 2026
@lpcox lpcox marked this pull request as ready for review May 12, 2026 01:00
@lpcox lpcox requested a review from Mossaka as a code owner May 12, 2026 01:00
Copilot AI review requested due to automatic review settings May 12, 2026 01:00
@github-actions
Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 87.89% 87.97% 📈 +0.08%
Statements 87.85% 87.92% 📈 +0.07%
Functions 83.51% 83.51% ➡️ +0.00%
Branches 79.79% 79.84% 📈 +0.05%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/container-lifecycle.ts 87.3% → 88.4% (+1.09%) 87.7% → 88.7% (+1.06%)

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

@github-actions
Copy link
Copy Markdown
Contributor

🔬 Smoke Test: Copilot BYOK (Offline) Mode

Test Result
GitHub MCP connectivity ❌ (401 - repo private/token scope)
GitHub.com HTTP connectivity ⚠️ (template vars not expanded)
File write/read ✅ (smoke-test-copilot-byok-25706645849.txt exists)
BYOK inference (api-proxy → api.githubcopilot.com)

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

Overall: PARTIAL PASS — BYOK inference path confirmed working; GitHub MCP returned 401 (credential scope issue, not BYOK-related).

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results
❌ GitHub MCP (auth unavailable in sandbox)
✅ Playwright: github.com page title verified
✅ File Writing: test file created
✅ Bash Tool: file contents verified

Status: PARTIAL (3/4 tests passed)

💥 [THE END] — Illustrated by Smoke Claude

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 standardizes generateDockerCompose imports in the src/services/* test suite by switching remaining tests from the backward-compatibility ../docker-manager barrel to the canonical ../compose-generator module, aligning import paths across peer tests.

Changes:

  • Updated 5 service test files to import generateDockerCompose from ../compose-generator.
  • Reduced reliance on the docker-manager compatibility barrel within the service test suite.
Show a summary per file
File Description
src/services/agent-volumes.test.ts Switch generateDockerCompose import to ../compose-generator.
src/services/agent-environment-runtime.test.ts Switch generateDockerCompose import to ../compose-generator.
src/services/agent-environment-proxy.test.ts Switch generateDockerCompose import to ../compose-generator.
src/services/agent-environment-options.test.ts Switch generateDockerCompose import to ../compose-generator.
src/services/agent-environment-credentials.test.ts Switch generateDockerCompose import to ../compose-generator.

Copilot's findings

Tip

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

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

@@ -1,4 +1,4 @@
import { generateDockerCompose } from '../docker-manager';
import { generateDockerCompose } from '../compose-generator';
@github-actions
Copy link
Copy Markdown
Contributor

🔬 Smoke Test Results

Test Result
GitHub MCP connectivity ❌ 401 Bad credentials
GitHub.com HTTP ⚠️ Template vars not expanded
File write/read /tmp/gh-aw/agent/smoke-test-copilot-25706645985.txt confirmed

Overall: FAIL — GitHub MCP returned 401; template variables (${{ steps.smoke-data.outputs.* }}) were not substituted before agent invocation.

📰 BREAKING: Report filed by Smoke Copilot

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test: FAIL

PRs: fix: add --ignore-scripts to security-guard Claude Code install; refactor: remove dead exports from export audit
✅ GitHub PR review/API; ❌ safeinputs-gh unavailable
✅ Playwright title; ❌ Tavily search unavailable
✅ file/bash; ⚠️ discussion skipped; ✅ build
Overall status: FAIL

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

🏗️ 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 passed ✅ PASS
Node.js execa passed ✅ PASS
Node.js p-limit 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 #2975 · ● 408.8K ·

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results

Check Result
Redis PING ❌ Connection timed out (host.docker.internal:6379)
PostgreSQL pg_isready ❌ No response (host.docker.internal:5432)
PostgreSQL SELECT 1 ❌ No response

Overall: FAIL — Services are not reachable from the agent environment. Neither host.docker.internal nor 127.0.0.1 resolved to running service containers.

🔌 Service connectivity validated by Smoke Services

@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
Node.js v24.14.1 v20.20.2
Go go1.22.12 go1.22.12

Result: FAILED — Python and Node.js versions differ between host and chroot. Go matches.

Tested by Smoke Chroot

@lpcox lpcox merged commit ac10c67 into main May 12, 2026
67 of 72 checks passed
@lpcox lpcox deleted the copilot/fix-import-path-inconsistency branch May 12, 2026 01:32
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 import path inconsistency: 5 service tests use docker-manager barrel instead of compose-generator

3 participants