Refactor workdir setup tests and guard fixture cleanup#5303
Conversation
Removes ~45 duplicated lines across three describe blocks by introducing setupWorkdirFixture(). Suites opt out of chroot-home cleanup via the cleanupChrootHome option.
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
There was a problem hiding this comment.
Pull request overview
This PR refactors src/workdir-setup.test.ts to reduce duplicated boilerplate by extracting a shared setupWorkdirFixture() helper that centralizes temp dir creation, config building, and Jest hook setup/cleanup.
Changes:
- Added
setupWorkdirFixture()to owntempDir,buildConfig(), and sharedbeforeEach/afterEach. - Updated the three test suites to use the fixture (and
fixture.tempDir) instead of repeating setup code. - Made chroot-home cleanup optional for the log-directories sub-function suite.
Show a summary per file
| File | Description |
|---|---|
| src/workdir-setup.test.ts | Refactors workdir setup tests to use a shared fixture helper and reduce duplicated setup/cleanup code. |
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: 1
| afterEach(() => { | ||
| fs.rmSync(tempDir, { recursive: true, force: true }); | ||
| fs.rmSync(`${tempDir}-chroot-home`, { recursive: true, force: true }); | ||
| if (cleanupChrootHome) { | ||
| fs.rmSync(`${tempDir}-chroot-home`, { recursive: true, force: true }); | ||
| } |
|
@copilot address the review feedback and fix the pr title and summary |
|
@copilot address the review feedback and fix the pr title and summary |
|
✅ Copilot review passed with no inline comments. @copilot Add the |
|
❌ Smoke Claude failed |
|
🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅ |
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
|
✅ Smoke Gemini completed. All facets verified. 💎 |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
✅ Build Test Suite completed successfully! |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🔌 Smoke Services — All services reachable! ✅ |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
🚀 Security Guard has started processing this pull request |
|
✅ Contribution Check completed successfully! |
Smoke Test: Copilot BYOK ✅ PASSTest Results:
Mode: Direct BYOK (COPILOT_PROVIDER_API_KEY via api-proxy sidecar)
|
|
Smoke Test COPILOT BYOK (Direct)
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) Overall: PASS cc
|
🔬 Smoke Test Results — PASS
PR: Refactor workdir setup tests and guard fixture cleanup Overall: PASS ✅
|
Smoke Test Results — PAT Auth
Overall: PASS (2/2 runnable tests passed; file test skipped — Auth mode: PAT (COPILOT_GITHUB_TOKEN)
|
Smoke Test: API Proxy OpenTelemetry Tracing
All 5 scenarios pass. OTEL tracing integration is working correctly.
|
Chroot Smoke Test Results
Overall: ❌ FAILED — Python and Node.js versions differ between host and chroot.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test: Services Connectivity
Overall: FAIL
|
Gemini Smoke Test Results
Overall Status: PASS 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.
|
|
|
|
[WIP] Refactor entrypoint.sh by extracting initialization phases into functions
|
/home/runner/work/gh-aw-firewall/gh-aw-firewall/src/workdir-setup.test.tssetupWorkdirFixture()helper to remove duplicated setup across the test suitesafterEachonly removes directories whentempDirwas creatednpm test -- src/workdir-setup.test.ts