[Test Coverage] container-startup-diagnostics coverage#5474
Conversation
Add container-startup-diagnostics-coverage.test.ts with 27 tests directly targeting the three previously uncovered functions: - didContainerFailStartup: all branches (string matching shortcut, docker inspect exited/unhealthy/healthy/non-zero exit/thrown error) - logContainerLogsToStderr: success with output, empty output (no emit), non-zero exit code (debug log), thrown exception (silent swallow) - handleHealthcheckError: blocked-domain path (is unhealthy keyword, dependency failed keyword), no-denial rethrow, non-matching rethrow, proxyLogsDir forwarding - reportBlockedDomains: empty target list, wildcard allowlist matching, else branch (allowed domain + standard port + matching protocol), https-only protocol mismatch, duplicate domain deduplication, fix-message scoping (domain/port/protocol shown only when relevant) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds direct unit-test coverage for container startup diagnostic helpers, improving confidence in failure classification and user-facing diagnostics without changing runtime behavior.
Changes:
- Added a new Jest test suite that directly exercises previously indirect/uncovered branches in
container-startup-diagnostics.ts. - Expanded branch coverage for
didContainerFailStartup,logContainerLogsToStderr,handleHealthcheckError, andreportBlockedDomains(including wildcard/protocol/“else” paths).
Show a summary per file
| File | Description |
|---|---|
src/container-startup-diagnostics-coverage.test.ts |
Adds comprehensive unit tests covering startup-failure detection, log-dumping behavior, blocked-domain diagnosis, and blocked-target classification branches. |
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
|
✅ Copilot review passed with no inline comments. @github-actions[bot] Add the |
|
✅ Smoke Gemini completed. All facets verified. 💎 Testing safeoutputs connectivity |
|
🔌 Smoke Services — All services reachable! ✅ |
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
|
✅ Smoke Claude passed |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Contribution Check completed successfully! Contribution check complete: PR #5474 follows the applicable CONTRIBUTING.md guidelines. It adds tests alongside the related source area, includes a clear PR description and testing note, and does not require documentation updates because it only adds test coverage. |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
🚀 Security Guard has started processing this pull request |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅ |
|
✅ Build Test Suite completed successfully! |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
| ); | ||
| // The else branch emits " - Blocked: github.com:443" with no extra annotation | ||
| expect(messages).toContain(' - Blocked: github.com:443'); | ||
| const blockedMsg = messages.find(m => m.includes('github.com:443')); |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
Coverage comparison generated by |
Smoke Test: Claude Engine
Overall result: PASS
|
🤖 Smoke Test Results — PASS
PR: [Test Coverage] container-startup-diagnostics coverage Overall: PASS
|
Smoke Test: Gemini Engine Validation
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 Results: Copilot BYOK (Direct) ModeStatus: ✅ PASS Tests:
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com. cc:
|
🔥 Smoke Test: Copilot PAT — PASS
Overall: PASS — Auth mode: PAT (COPILOT_GITHUB_TOKEN) PR: [Test Coverage] container-startup-diagnostics coverage — author
|
🔬 Smoke Test: API Proxy OpenTelemetry Tracing
All 5 scenarios passed. OTEL tracing integration is complete and functional.
|
|
|
Chroot Version Comparison Results
Overall: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot environments.
|
|
Smoke test results: PASS 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.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test: Services Connectivity
Overall: FAIL
|
|
✅ GitHub MCP Testing 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 status: PASS
|
Adds
src/container-startup-diagnostics-coverage.test.tswith 27 new tests directly exercising three previously untested functions incontainer-startup-diagnostics.ts.Coverage added
didContainerFailStartupis unhealthy→true(no inspect call)exited (1)→truedocker inspectwhen string pattern doesn't matchcontainerStatus === 'exited'→truehealthStatus === 'unhealthy'→truerunning|healthy→falsefalsefalse(catch path)falselogContainerLogsToStderrlogger.errorlogger.errorcalldocker logs→ emits debug messagehandleHealthcheckErroris unhealthykeyword + denials in Squid logs → throws blocked-domain errordependency failedkeyword + denials → throws blocked-domain erroris unhealthy+ no denials → rethrows original errorcheckSquidLogsproxyLogsDirforwarded correctly tocheckSquidLogsreportBlockedDomains(additional branches)*.github.com) matches subdomain targetselsebranch: allowed domain + standard port + matching protocol → generic- Blocked:with no annotationundefinedport (protocol =both) handled correctlyTesting
All 27 new tests pass. No existing tests modified.