refactor: extract shared signal-handler test fixture to eliminate duplication#6132
Conversation
There was a problem hiding this comment.
Pull request overview
Extracts duplicated signal-handler test setup into a reusable harness.
Changes:
- Adds shared promise flushing and Jest spy lifecycle utilities.
- Refactors both signal-handler test suites to use the harness.
- Preserves existing signal-handler coverage.
Show a summary per file
| File | Description |
|---|---|
src/commands/signal-handler.test-utils.ts |
Adds the shared test harness and helper. |
src/commands/signal-handler.test.ts |
Replaces duplicated fixture setup. |
src/coverage-branch-gaps-3.test.ts |
Reuses the shared fixture for branch tests. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Medium
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
✅ Copilot review passed with no inline comments. @copilot Add the |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
✨ New Files (1 files)
Coverage comparison generated by |
|
✅ Smoke Claude passed |
|
🔌 Smoke Services — All services reachable! ✅ |
|
🚀 Security Guard has started processing this pull request |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Smoke Gemini completed. All facets verified. 💎 Smoke test completed with FAIL status. |
|
🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅ |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
|
📰 DEVELOPING STORY: Smoke Docker Sbx reports failed. Our correspondents are investigating the incident... |
|
✅ Build Test Suite completed successfully! |
|
✅ Contribution Check completed successfully! |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
Smoke Test Results
Overall: FAIL Auth mode: PAT (COPILOT_GITHUB_TOKEN) Note: Workflow template variables ( Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
|
Thanks for the focused refactor. One contribution-guideline item is missing: please reference any related issue in the PR description, or explicitly state that there is no related issue. This is required by CONTRIBUTING.md under Pull Request Process → Pull request requirements ("Reference any related issues"). Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Smoke Test: Claude Engine Validation
Overall Result: PASS ✅ Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
|
#6132: Smoke test for Copilot BYOK (Direct) Mode — Azure OpenAI
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) Overall: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Smoke Test: Services Connectivity
Overall: FAIL — Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
|
Smoke Test: Copilot BYOK Direct Mode — ✅ GitHub.com connectivity (HTTP 200) Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com Overall: PASS 🔓 Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Smoke Test Results
Overall: FAIL — pre-step outputs not substituted cc Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
🔭 OTEL Smoke Test Results
All scenarios pass. OTEL tracing integration is healthy. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Chroot Version Comparison Results
Result: Not all tests passed — Python and Node.js versions differ between host and chroot. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
|
feat: add gVisor smoke tests for Claude, Codex, and build workloads ✅ Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"
- "registry.npmjs.org"See Network Configuration for more information.
|
Smoke Test Results: Gemini Engine
Overall Status: FAIL Merged PR Titles:
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.
|
|
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: FAIL Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
flushPromises, thehandlersregistry, and the three Jest process/console spies with theirbeforeEach/afterEachlifecycle were duplicated verbatim acrosssignal-handler.test.tsandcoverage-branch-gaps-3.test.ts— any change to the mocking strategy required two edits.Changes
New
src/commands/signal-handler.test-utils.ts— exports:flushPromises— shared Promise-flush helpercreateSignalHandlerTestHarness()— factory that mocksprocess.onto capture registered signal handlers, sets upprocess.exitandconsole.errorspies, and wiresbeforeEach/afterEachteardown automatically; returns a typedharnessobjectSignalHandlerTestHarness— exported return typesignal-handler.test.ts— replaces ~24 lines of boilerplate with a singlecreateSignalHandlerTestHarness()call; accesses spies and handlers viaharness.*coverage-branch-gaps-3.test.ts— same replacement; removes localflushPromises,handlers, and all three spy vars