Skip to content

Disambiguate internal test-helper exports across six modules#3826

Merged
lpcox merged 2 commits into
mainfrom
copilot/export-audit-fix-duplicate-testhelpers
May 26, 2026
Merged

Disambiguate internal test-helper exports across six modules#3826
lpcox merged 2 commits into
mainfrom
copilot/export-audit-fix-duplicate-testhelpers

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 26, 2026

The codebase exported testHelpers from six different modules, creating avoidable naming collisions and forcing import aliasing in tests. This change makes each test-only helper export module-specific so import intent is explicit and collision-free.

  • API surface cleanup (test-only exports)

    • host-iptables-shared.tsiptablesSharedTestHelpers
    • copilot-api-resolver.tscopilotApiResolverTestHelpers
    • host-env.tshostEnvTestHelpers
    • container-lifecycle.tscontainerLifecycleTestHelpers
    • host-iptables-network.tsiptablesNetworkTestHelpers
    • logs/log-discovery.tslogDiscoveryTestHelpers
  • Consumer updates (tests)

    • Updated all affected unit tests to import the new names directly.
    • Removed now-unnecessary aliasing where imports were only aliased to avoid testHelpers collisions.
  • Resulting pattern

    • Test-only exports are now self-describing at import sites and no longer conflict when multiple helper modules are used together.
// Before
import { testHelpers as networkTestHelpers } from './host-iptables-network';
import { testHelpers } from './host-iptables-shared';

// After
import { iptablesNetworkTestHelpers } from './host-iptables-network';
import { iptablesSharedTestHelpers } from './host-iptables-shared';

Copilot AI changed the title [WIP] Fix duplicate testHelpers export name across modules Disambiguate internal test-helper exports across six modules May 26, 2026
Copilot finished work on behalf of lpcox May 26, 2026 00:16
Copilot AI requested a review from lpcox May 26, 2026 00:16
@lpcox lpcox marked this pull request as ready for review May 26, 2026 00:45
Copilot AI review requested due to automatic review settings May 26, 2026 00:45
@github-actions
Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 96.54% 96.58% 📈 +0.04%
Statements 96.38% 96.42% 📈 +0.04%
Functions 97.99% 97.99% ➡️ +0.00%
Branches 90.78% 90.82% 📈 +0.04%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/config-writer.ts 89.3% → 90.9% (+1.65%) 89.3% → 90.9% (+1.65%)

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

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 removes ambiguous testHelpers exports from several internal modules by renaming them to module-specific *TestHelpers exports, and updates all impacted unit tests to import the new names directly—eliminating naming collisions and unnecessary aliasing in test code.

Changes:

  • Renamed test-only helper export objects to module-specific names (e.g., logDiscoveryTestHelpers, iptablesSharedTestHelpers, etc.).
  • Updated all affected unit tests to use the new export names and removed collision-driven import aliasing where it was only used to disambiguate testHelpers.
  • Kept the helpers explicitly marked as @internal / test-only while making import intent clearer at call sites.
Show a summary per file
File Description
src/logs/log-discovery.ts Renames testHelpers export to logDiscoveryTestHelpers.
src/logs/log-discovery.test.ts Updates imports/usages to logDiscoveryTestHelpers.
src/host-iptables-shared.ts Renames testHelpers export to iptablesSharedTestHelpers.
src/host-iptables-shared.test.ts Updates imports/usages to iptablesSharedTestHelpers.
src/host-iptables-setup.test.ts Updates imports/usages to iptablesSharedTestHelpers.
src/host-iptables-network.ts Renames testHelpers export to iptablesNetworkTestHelpers.
src/host-iptables-network.test.ts Updates imports/usages to iptablesNetworkTestHelpers and iptablesSharedTestHelpers; removes aliasing.
src/host-iptables-host-access.test.ts Updates imports/usages to iptablesSharedTestHelpers.
src/host-iptables-doh.test.ts Updates imports/usages to iptablesSharedTestHelpers.
src/host-iptables-cleanup.test.ts Updates imports/usages to iptablesSharedTestHelpers.
src/host-env.ts Renames testHelpers export to hostEnvTestHelpers.
src/docker-manager-utils.test.ts Updates imports/usages to hostEnvTestHelpers.
src/docker-manager-lifecycle.test.ts Updates imports/usages to containerLifecycleTestHelpers (removes aliasing).
src/copilot-api-resolver.ts Renames testHelpers export to copilotApiResolverTestHelpers.
src/copilot-api-resolver.test.ts Updates imports/destructuring to copilotApiResolverTestHelpers.
src/container-lifecycle.ts Renames testHelpers export to containerLifecycleTestHelpers.
src/cli.test.ts Updates imports to copilotApiResolverTestHelpers without aliasing.

Copilot's findings

Tip

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

  • Files reviewed: 17/17 changed files
  • Comments generated: 0

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine

  • ✅ GitHub API: 2 recent PRs fetched
  • ✅ GitHub check (playwright): PASS
  • ✅ File verify: smoke-test-claude-26425126880.txt present

Result: PASS

💥 [THE END] — Illustrated by Smoke Claude

@github-actions
Copy link
Copy Markdown
Contributor

🔬 Smoke Test Results

Test Result
GitHub MCP connectivity ✅ PR data fetched successfully
GitHub.com HTTP connectivity ⚠️ N/A (template vars not expanded)
File write/read ⚠️ N/A (template vars not expanded)

PR: "Disambiguate internal test-helper exports across six modules" by @Copilot, assigned to @lpcox and @Copilot.

Overall: PARTIAL — MCP test passed; pre-step smoke data was not injected (unexpanded ${{ }} template variables).

📰 BREAKING: Report filed by Smoke Copilot

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Offline) Mode

Test Result
GitHub MCP connectivity ✅ PR list returned successfully
GitHub.com HTTP check ⚠️ Pre-step data not expanded (template var unexpanded)
File write/read ⚠️ Pre-step data not expanded (template var unexpanded)
BYOK inference (api-proxy → api.githubcopilot.com) ✅ Responding via BYOK offline mode

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

Overall: PARTIAL — BYOK inference and MCP working; pre-step smoke data template vars were not substituted.

PR author: @Copilot | Assignees: @lpcox, @Copilot

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions github-actions Bot mentioned this pull request May 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

fix(api-proxy): prevent stream_options injection into OpenAI Responses API requests ✅
Filter unresolvable model aliases from /reflect and models.json ✅
Build ✅
Browser ✅
File ✅
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

Chroot Runtime Version Comparison

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.3
Node.js v24.15.0 v22.22.3
Go go1.22.12 go1.22.12

Result: Not all tests passed — Python and Node.js versions differ between host and chroot environments.

Tested by Smoke Chroot

@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 #3826 · sonnet46 992.7K ·

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results: FAIL

Check Result
Redis PING ❌ Timeout/no response
PostgreSQL pg_isready ❌ No response
PostgreSQL SELECT 1 ❌ Timeout/no response

host.docker.internal is unreachable from this environment — service containers are not accessible.

🔌 Service connectivity validated by Smoke Services

@github-actions
Copy link
Copy Markdown
Contributor

Smoke test 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

@lpcox
Copy link
Copy Markdown
Collaborator

lpcox commented May 26, 2026

@copilot address review feedback

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 26, 2026

@copilot address review feedback

I checked the PR review output and there are currently no actionable review comments/threads (the Copilot review reported “Comments generated: 0”). Please point me to the specific feedback you want addressed, and I’ll apply it immediately.

Copilot finished work on behalf of lpcox May 26, 2026 02:20
@lpcox lpcox merged commit d7b8c8c into main May 26, 2026
64 of 67 checks passed
@lpcox lpcox deleted the copilot/export-audit-fix-duplicate-testhelpers branch May 26, 2026 02: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] Duplicate testHelpers export name across 6 modules

3 participants