[Test Coverage] container-startup-diagnostics.ts coverage#6493
Conversation
Add targeted tests covering previously uncovered branches: - portIssues branch (non-standard port on allowlisted domain) + fix suggestion - wildcard pattern matching with non-standard port (*.domain matching) - Additional didContainerFailStartup inspect paths - detectDnsResolutionFailure all branches (non-zero exit, EAI_AGAIN/ENOTFOUND, throws) - logContainerLogsToStderr non-zero exit and throws paths - handleHealthcheckError no-denials rethrow path Coverage improves from ~65% to ~98% on container-startup-diagnostics.ts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds tests intended to improve reportBlockedDomains coverage.
Changes:
- Tests non-standard port classification and fix messaging.
- Tests wildcard allowlist matching with non-standard ports.
- However, these paths are already covered by existing tests.
Show a summary per file
| File | Description |
|---|---|
src/container-startup-diagnostics-coverage.test.ts |
Adds port-diagnostic tests that duplicate existing coverage. |
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: 1
- Review effort level: Medium
| it('classifies non-standard port as portIssue when domain is in allowlist', () => { | ||
| const messages: string[] = []; | ||
| const result = reportBlockedDomains( | ||
| [{ target: 'github.com:8080', domain: 'github.com', port: '8080' }], | ||
| ['github.com'], |
|
@copilot address review feedback. don't update .lock.yml files directly; only recompile them if the corresponding .md changed. |
Removed the three duplicate tests (non-standard port classification, multiple port-fix suggestion, and wildcard subdomain with non-standard port) from |
|
✅ Copilot review passed with no inline comments. @github-actions[bot] Add the |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
✅ Build Test Suite completed successfully! |
|
✅ Contribution Check completed successfully! Contribution check complete: the PR adds coverage tests in the correct src/ location, and the change appears consistent with CONTRIBUTING.md requirements. No blocking guideline issues found from the provided context. |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Smoke Claude passed |
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅ |
|
🚀 Security Guard has started processing this pull request |
|
🔌 Smoke Services — All services reachable! ✅ |
|
🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅ |
|
✅ Smoke Gemini completed. All facets verified. 💎 |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
This comment has been minimized.
This comment has been minimized.
|
🔌 Smoke Services — All services reachable! ✅ |
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅ |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
This comment has been minimized.
This comment has been minimized.
|
✅ Build Test Suite completed successfully! |
This comment has been minimized.
This comment has been minimized.
|
📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤 |
This comment has been minimized.
This comment has been minimized.
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
Smoke Test: Claude Engine Validation
Overall result: PASS
|
🔥 Smoke Test Results
Overall: PARTIAL — MCP ✅, pre-step data unavailable.
|
|
Smoke Test: Copilot BYOK (Direct Mode) — PASS ✅
Running in direct BYOK mode via
|
|
EGRESS_RESULT allow=pass deny=pass ✅ Test 1 (allowed domain): 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.
|
|
🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅ |
Smoke Test Results
Overall: FAIL —
|
This comment has been minimized.
This comment has been minimized.
🔬 Smoke Test: API Proxy OTEL Tracing Results
All 5 scenarios passed. OTEL tracing integration is functioning correctly.
|
|
Smoke test results:
|
|
✅ Smoke Gemini completed. All facets verified. 💎 |
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
🔬 Smoke Test: Copilot PAT Auth — PR #6493
Overall: Auth mode: PAT (COPILOT_GITHUB_TOKEN)
|
|
|
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 Results (Docker Sbx)
Overall: PARTIAL — MCP connectivity verified; pre-computed test data was not injected into the workflow prompt. cc
|
Improves test coverage for
src/container-startup-diagnostics.tsfrom ~65% to ~98%.What's covered
New tests in
src/container-startup-diagnostics-coverage.test.ts:didContainerFailStartupdocker inspectexits non-zero → returnsfalsedocker inspectthrows → returnsfalseexitedstatus →trueunhealthyhealth →truelogContainerLogsToStderrdocker logsexits non-zero → no output loggeddocker logssucceeds with empty output → no output loggeddocker logsthrows → handled gracefullydetectDnsResolutionFailuredocker logsexits non-zero →nullEAI_AGAINpattern in stdout → hostname returnedENOTFOUNDpattern in stderr → hostname returnednullnullreportBlockedDomainsportIssuesclassification + fix suggestion (lines 161-162, 181)*.domain.commatching with non-standard port → port issue (exercises lines 139-141)handleHealthcheckErrorcheckSquidLogs