Refactor writeConfigs cleanup tests to remove duplicated config + tolerant-failure scaffolding#5352
Refactor writeConfigs cleanup tests to remove duplicated config + tolerant-failure scaffolding#5352Copilot wants to merge 4 commits into
writeConfigs cleanup tests to remove duplicated config + tolerant-failure scaffolding#5352Conversation
writeConfigs cleanup tests to remove duplicated config + tolerant-failure scaffolding
There was a problem hiding this comment.
Pull request overview
This PR refactors src/docker-manager-cleanup.test.ts to reduce repeated WrapperConfig setup and repeated writeConfigs try/catch scaffolding, keeping the tests focused on filesystem side effects and permissions.
Changes:
- Added
createWriteConfig(overrides)helper to centralize baselineWrapperConfigconstruction forwriteConfigstests. - Added
writeConfigsAllowingLateFailure(config)helper to consolidate the “ignore errors but keep side-effect assertions” pattern. - Updated multiple
writeConfigstests to use these helpers (work dir creation, log dirs, config file checks, permission checks,proxyLogsDir, and gemini/chroot-home precreation).
Show a summary per file
| File | Description |
|---|---|
| src/docker-manager-cleanup.test.ts | Consolidates repeated config setup and error-tolerant writeConfigs invocation into local helpers to reduce boilerplate in cleanup/config 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: 2
| const writeConfigsAllowingLateFailure = async (config: WrapperConfig): Promise<void> => { | ||
| try { | ||
| await writeConfigs(config); | ||
| } catch { | ||
| // Expected to fail if seccomp profile not found, but directories should still be created | ||
| // writeConfigs may fail late (e.g., seccomp/config writes), but earlier side effects should remain | ||
| } |
| const config = createWriteConfig({ allowedDomains: ['github.com', 'example.com'] }); | ||
| await writeConfigsAllowingLateFailure(config); | ||
|
|
||
| // Verify squid.conf was created (it's created before seccomp check) |
|
@copilot address review feedback |
Addressed. I updated |
|
🔌 Smoke Services — All services reachable! ✅ |
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
|
✅ Smoke Claude passed |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Smoke Gemini completed. All facets verified. 💎 Testing GitHub MCP connectivity |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
✅ Build Test Suite completed successfully! |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
|
🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅ |
|
Smoke Test: Copilot BYOK (Direct Mode) — PASS ✅
Running in direct BYOK mode via
|
🔬 Smoke Test ResultsPR: Refactor
Overall: PASS (2/3 verified; file test skipped due to unexpanded workflow template vars)
|
|
Smoke Test Summary:
PRs:
Overall Status: FAIL (Connectivity test failed) 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.
|
🔬 Smoke Test: Copilot PAT Auth — PASS
Auth mode: PAT (COPILOT_GITHUB_TOKEN) cc
|
|
Smoke test results:
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: API Proxy OpenTelemetry Tracing
All scenarios pass. The OTEL tracing integration is fully functional with correct span creation, token usage attributes, parent context propagation support, and graceful degradation when unconfigured.
|
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 Results — FAIL ❌
Overall: FAIL
|
|
Smoke test results:
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
|
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
|
Split docker-manager cleanup tests by concern ✅ Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) Overall: PASS
|
|
@copilot resolve the merge conflicts in this pull request |
…e-writeconfigs-tests # Conflicts: # src/docker-manager-cleanup.test.ts
Resolved the merge conflicts and completed the merge with |
Head branch was pushed to by a user without write access
src/docker-manager-cleanup.test.tsrepeated the same minimalWrapperConfigconstruction and identicalwriteConfigstry/catch blocks across multiplewriteConfigstests. This PR consolidates that pattern so tests focus on filesystem/permission assertions rather than setup boilerplate.What changed
createWriteConfig(overrides?)helper in thewriteConfigstest block to centralize baseline config creation.writeConfigsAllowingFailure(config)helper to encapsulate the shared “allow failure, keep side-effect assertions” behavior.proxyLogsDirvariants, chroot-home and gemini-home precreation).squid.conftest comment to avoid claiming an incorrect write order.Why this structure