refactor: extract shared helper to eliminate duplicate test scaffold in docker-host-env tests#5419
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors src/docker-host-env.test.ts to remove duplicated test scaffolding around startContainers calls, improving consistency and reducing repetition in the DOCKER_HOST isolation tests.
Changes:
- Extracted a shared inline helper
runStartContainersAndGetComposeEnv()within thedescribeblock to centralize temp dir setup, mockedexecaresults,startContainers()execution, and docker compose env extraction. - Updated the three DOCKER_HOST boundary tests to use the helper and focus only on preconditions + assertions.
Show a summary per file
| File | Description |
|---|---|
| src/docker-host-env.test.ts | Refactors repeated test setup into a shared helper and simplifies the three DOCKER_HOST forwarding/override tests. |
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: 0
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
|
🔌 Smoke Services — All services reachable! ✅ |
|
✅ Smoke Claude passed |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅ |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
✅ Build Test Suite completed successfully! |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed... |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Smoke Gemini completed. All facets verified. 💎 |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
Smoke Test: Copilot BYOK (Direct Mode) ✅ PASSTest Results:
Mode: Direct BYOK (COPILOT_PROVIDER_API_KEY) via api-proxy sidecar
|
Smoke Test: Claude Engine Validation
Overall result: PASS
|
🔥 Smoke Test Results — PASS
PR: refactor: extract shared helper to eliminate duplicate test scaffold in docker-host-env tests Overall: PASS
|
🔥 Smoke Test Results — Auth mode: PAT (COPILOT_GITHUB_TOKEN)
Overall: FAIL cc
|
|
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: PASS
|
Gemini Smoke Test Results
Overall status: FAIL Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
Chroot Version Comparison Results
Overall: ❌ Tests did not pass — Python and Node.js versions differ between host and chroot environments.
|
📡 OTel Tracing Smoke Test Results
All scenarios pass. ✅
|
Smoke Test
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: GitHub Actions Services Connectivity
Overall: FAIL
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Three tests in
src/docker-host-env.test.tsrepeated an identical ~20-line block: temp dir setup, twomockResolvedValueOncecalls,startContainersinvocation, compose-call filtering, env extraction, and cleanup.Changes
src/docker-host-env.test.ts: extractedrunStartContainersAndGetComposeEnv()as an inline helper inside thedescribeblock. It owns the full scaffold and returns the env object from the first docker compose call. Each test now only sets up itsDOCKER_HOST/setAwfDockerHostprecondition and asserts the expected forwarded value.Before (repeated three times):
After:
Net result: ~30 lines removed, assertion consistency guaranteed across all three ARC/DinD DOCKER_HOST boundary tests.