tests: replace host-env barrel imports with canonical host-env split modules#3427
Conversation
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
This PR updates unit tests to stop importing host environment helpers via the src/host-env.ts backwards-compat barrel when canonical split modules exist, helping keep module boundaries clear and preventing dead re-exports from being kept alive by tests.
Changes:
- Replaced
./host-envbarrel imports in tests with direct imports from./host-identity,./github-env, and./constantswhere appropriate. - Kept
./host-envimports only for symbols that still live there (testHelpers,stripScheme). - Adjusted
config-writer.test.tsmocks sogetRealUserHomebehavior stays aligned acrosshost-envandhost-identity.
Show a summary per file
| File | Description |
|---|---|
| src/docker-manager-utils.test.ts | Splits a large host-env barrel import into focused host-identity + github-env imports, keeping only remaining host-env symbols. |
| src/docker-manager-lifecycle.test.ts | Switches AGENT_CONTAINER_NAME import to the canonical constants module. |
| src/config-writer.test.ts | Updates getRealUserHome import to host-identity and aligns mocks between host-env and host-identity. |
| src/compose-generator.test.ts | Switches ACT_PRESET_BASE_IMAGE import to the canonical host-identity module. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 0
This comment has been minimized.
This comment has been minimized.
|
@copilot fix this failing ci check https://github.com/github/gh-aw-firewall/actions/runs/26108010949/job/76842328156?pr=3427 |
Addressed in 78e8dc6. I updated Security Guard’s relevance filter to ignore test-only file paths ( |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@copilot merge main |
…fix-imports # Conflicts: # src/docker-manager-utils.test.ts
Merged |
|
✅ GitHub API (2 PR entries found) Result: PASS
|
🔥 Smoke Test: Copilot BYOK (Offline) Mode
Running in BYOK offline mode ( Author: Overall: PARTIAL PASS (BYOK inference + MCP confirmed ✅; pre-step outputs not expanded)
|
Smoke Test Codex: FAIL✅ GitHub PR review: Refactor option parser facade to direct re-exports and unify flag validation type; Prune dead Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
🔬 Smoke Test Results
PR: tests: replace host-env barrel imports with canonical host-env split modules
|
Chroot Runtime Version Comparison
Result: Not all tests passed — Python and Node.js versions differ between host and chroot environments.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test: Gemini Engine Validation - FAILWarning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
Smoke Test Results
Overall: FAIL —
|
Several unit tests still imported symbols from
src/host-env.ts(backward-compat barrel) instead of the post-split canonical modules, which kept dead re-exports artificially alive and blurred module boundaries.This PR updates those tests to import from the focused modules (
host-identity,github-env,constants) while keepinghost-envimports only for symbols still owned there.Import path realignment
src/docker-manager-utils.test.ts./host-identity./github-envtestHelpersandstripSchemein./host-envsrc/docker-manager-lifecycle.test.tsAGENT_CONTAINER_NAMEimport to./constantssrc/compose-generator.test.tsACT_PRESET_BASE_IMAGEimport to./host-identityMock consistency for split modules
src/config-writer.test.tsgetRealUserHometest import to./host-identity./host-envand./host-identitymocks to the samemockGetRealUserHomefunction so behavior remains aligned with existing test expectationsRepresentative change