[Test Coverage] main-action sbx coverage gaps#6582
Conversation
Cover uncovered branches in src/commands/main-action.ts: - sbx isSbxAvailable=false error path - sbx api-proxy health check failure (proceeds with warning) - sbx runAgentCommand non-zero exit with enableApiProxy diagnostics - sbx cleanup removeSandbox with keepContainers=false vs true - non-sbx runAgentCommand containerRuntime passthrough - sbx dnsOverHttps wiring - GITHUB_WORKSPACE env var fallback in createSandbox Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds Jest coverage for sbx and Docker runtime branches in createMainAction.
Changes:
- Tests sbx availability, diagnostics, cleanup, and environment wiring.
- Tests runtime forwarding and workspace selection.
Show a summary per file
| File | Description |
|---|---|
src/commands/main-action-coverage-gaps.test.ts |
Adds targeted branch-coverage tests for main-action.ts. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 5
- Review effort level: Medium
| processExitSpy = jest.spyOn(process, 'exit').mockImplementation((code?: string | number | null) => { | ||
| if (code !== 0) { | ||
| throw new Error(`process.exit: ${code}`); | ||
| } |
| const action = createMainAction(getOptionValueSource); | ||
| // process.exit(42) is caught by the outer try-catch which then calls process.exit(1) | ||
| await expect(action(['echo hi'], {})).rejects.toThrow('process.exit: 1'); |
| // sbxEnvironment should have been built; just verify no fatal errors | ||
| expect(mockedSbxManager.createSandbox).toHaveBeenCalled(); |
| describe('sbx: GITHUB_WORKSPACE env fallback', () => { | ||
| it('falls back to cwd when GITHUB_WORKSPACE is not set', async () => { | ||
| delete process.env.GITHUB_WORKSPACE; |
|
@copilot merge main and address review feedback |
…tion-coverage-gaps-91b6ed95513682f1
Merged |
|
✅ Contribution Check completed successfully! |
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅ |
|
🔌 Smoke Services — All services reachable! ✅ |
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
|
✅ Smoke Gemini completed. All facets verified. 💎 Testing safeoutputs and reporting initial results. Connectivity check failed with 000. File creation succeeded. |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
🚀 Security Guard has started processing this pull request |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
✅ Smoke Claude passed |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
|
✅ Build Test Suite completed successfully! |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
Coverage comparison generated by |
|
📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤 |
|
🔌 Smoke Services — All services reachable! ✅ |
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
|
✅ Smoke Gemini completed. All facets verified. 💎 |
|
✅ Contribution Check completed successfully! |
|
✅ Build Test Suite completed successfully! |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
✅ Smoke Claude passed |
|
📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤 |
🔥 Smoke Test Results
Overall: PASS /cc
|
|
Smoke test: Copilot network isolation egress —
Overall: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
|
This PR is solid on the code/test side, but it appears to be missing a related issue reference in the description. CONTRIBUTING.md’s PR process asks for a clear description and a link to any related issues. If there is an issue for these coverage gaps, please add it to the PR body. The new Jest test file is in the right place and the coverage addition itself looks fine.
|
Smoke Test: Copilot BYOK (Direct) ✅Mode: Direct BYOK (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com Test Results:
Status: PASS — All verification tests passed. Agent is running in direct BYOK mode with credentials isolated to api-proxy sidecar.
|
Smoke Test: Claude Engine Validation
Overall result: PASS
|
Smoke Test: Services Connectivity
Overall: FAIL —
|
Chroot Version Comparison Results
Overall: ❌ FAILED — Node.js version mismatch between host (
|
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.
|
🔬 Smoke Test: API Proxy OpenTelemetry Tracing
Overall: All scenarios pass ✅
|
|
Smoke Test Results (BYOK Direct Azure OpenAI Entra)
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
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
|
|
🔥 Smoke Test: Docker Sbx — PASS
Overall: PASS ·
|
Adds targeted Jest tests for previously uncovered branches in
src/commands/main-action.ts.What's covered
isSbxAvailable()returnsfalse→ throwsrunAgentCommandnon-zero exit withenableApiProxy→ dumps logskeepContainers=false→ callsremoveSandboxkeepContainers=true→ skipsremoveSandboxrunAgentCommandpassescontainerRuntimethroughdnsOverHttpsflag wiresdohProxyIpin sbx environmentGITHUB_WORKSPACEenv var used / falls back tocwd()Approach
src/commands/main-action-coverage-gaps.test.tsfollowing the existingmain-action.test.tsmocking patterns