Skip to content

[Test Coverage] container-startup-diagnostics.ts coverage#6493

Merged
lpcox merged 2 commits into
mainfrom
test-coverage/container-startup-diagnostics-coverage-c99b95e83d0ec7d8
Jul 22, 2026
Merged

[Test Coverage] container-startup-diagnostics.ts coverage#6493
lpcox merged 2 commits into
mainfrom
test-coverage/container-startup-diagnostics-coverage-c99b95e83d0ec7d8

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Improves test coverage for src/container-startup-diagnostics.ts from ~65% to ~98%.

What's covered

New tests in src/container-startup-diagnostics-coverage.test.ts:

didContainerFailStartup

  • docker inspect exits non-zero → returns false
  • docker inspect throws → returns false
  • Inspect output shows exited status → true
  • Inspect output shows unhealthy health → true

logContainerLogsToStderr

  • docker logs exits non-zero → no output logged
  • docker logs succeeds with empty output → no output logged
  • docker logs throws → handled gracefully

detectDnsResolutionFailure

  • docker logs exits non-zero → null
  • EAI_AGAIN pattern in stdout → hostname returned
  • ENOTFOUND pattern in stderr → hostname returned
  • No DNS pattern → null
  • Throws → null

reportBlockedDomains

  • Non-standard port on allowlisted domain → portIssues classification + fix suggestion (lines 161-162, 181)
  • Wildcard *.domain.com matching with non-standard port → port issue (exercises lines 139-141)
  • Protocol mismatch path
  • Else branch (allowed domain, standard port)

handleHealthcheckError

  • No denials found → rethrows original error
  • Error message doesn't match → rethrows without calling checkSquidLogs
  • Denials found → user-friendly domain error

Generated by Test Coverage Improver · 105.5 AIC · ⊞ 6.2K ·

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>
@lpcox
lpcox marked this pull request as ready for review July 22, 2026 13:33
Copilot AI review requested due to automatic review settings July 22, 2026 13:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +413 to +417
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'],
@lpcox

lpcox commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback. don't update .lock.yml files directly; only recompile them if the corresponding .md changed.

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

@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 container-startup-diagnostics-coverage.test.ts. These were already covered by the existing test in container-startup-diagnostics.test.ts:4-27. Committed in 5b4f01c.

Copilot finished work on behalf of lpcox July 22, 2026 16:03
Copilot AI requested a review from lpcox July 22, 2026 16:03
@github-actions

Copy link
Copy Markdown
Contributor Author

✅ Copilot review passed with no inline comments.

@github-actions[bot] Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Build Test Suite completed successfully!

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

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.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Claude passed

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

@github-actions

Copy link
Copy Markdown
Contributor Author

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Gemini completed. All facets verified. 💎

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Build Test Suite completed successfully!

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test: Claude Engine Validation

Check Result
API status ✅ PASS
GH check ✅ PASS
File status ✅ PASS

Overall result: PASS

Generated by Smoke Claude for #6493 · 54.2 AIC · ⊞ 3.2K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

🔥 Smoke Test Results

Test Status
GitHub MCP Connectivity ✅ PASS (PR list tool responded)
GitHub.com HTTP ⚠️ N/A (pre-step data unavailable)
File Write/Read ⚠️ N/A (pre-step data unavailable)

i️ Pre-computed smoke data (steps.smoke-data.outputs) was not populated — template variables were unexpanded. MCP connectivity confirmed.

Overall: PARTIAL — MCP ✅, pre-step data unavailable.

📰 BREAKING: Report filed by Smoke Copilot
Add label ready-for-aw to run again

@lpcox
lpcox enabled auto-merge (squash) July 22, 2026 16:20
@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test: Copilot BYOK (Direct Mode) — PASS ✅

  • ✅ GitHub MCP connectivity
  • ✅ github.com HTTP connectivity (200)
  • ✅ File read/write access
  • ✅ BYOK inference (agent → api-proxy sidecar → api.githubcopilot.com)

Running in direct BYOK mode via COPILOT_PROVIDER_API_KEY path.

🔑 BYOK report filed by Smoke Copilot BYOK
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

@lpcox — Smoke test: Copilot Network Isolation

EGRESS_RESULT allow=pass deny=pass

✅ Test 1 (allowed domain): api.github.comallowed=200
✅ Test 2 (blocked domain): example.com → blocked (403 via proxy)

Overall: PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • example.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "example.com"

See Network Configuration for more information.

🛡️ Egress verdict from Smoke Copilot Network Isolation
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test Results

  • Redis PING: ❌ (host.docker.internal DNS resolution failed)
  • PostgreSQL pg_isready: ❌ (no response)
  • PostgreSQL SELECT 1: ❌ (DNS resolution failed)

Overall: FAILhost.docker.internal is not resolvable in this environment.

🔌 Service connectivity validated by Smoke Services
Add label ready-for-aw to run again

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor Author

🔬 Smoke Test: API Proxy OTEL Tracing Results

Scenario Status Notes
Module Loading otel.js loads; exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled, plus internal helpers
Test Suite 39/39 tests passed in otel.test.js (all OTEL sub-suites: ProxyAwareOtlpExporter, FileSpanExporter, shutdown)
Env Var Forwarding src/services/api-proxy-env-config.ts forwards GH_AW_OTLP_ENDPOINTS, OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, GITHUB_AW_OTEL_TRACE_ID, GITHUB_AW_OTEL_PARENT_SPAN_ID, OTEL_SERVICE_NAME
Token Tracker Integration onUsage callback exists in token-tracker-http.js (line 285, 343) as the OTEL hook point
OTEL Diagnostics No errors; graceful degradation confirmed when OTEL not configured

All 5 scenarios passed. OTEL tracing integration is functioning correctly.

📡 OTel tracing validated by Smoke OTel Tracing
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke test results:

  • GitHub PR queries: ❌ (safeinputs-gh/gh unavailable in this runner)
  • Playwright: ✅ GitHub page title verified
  • File write/read: ✅
  • Build: ❌ npm not available
    Overall: FAIL

🔮 The oracle has spoken through Smoke Codex
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Gemini completed. All facets verified. 💎

@github-actions

Copy link
Copy Markdown
Contributor Author

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A ✅ PASS
.NET json-parse N/A ✅ PASS
Go color 1/1 passed ✅ PASS
Go env 1/1 passed ✅ PASS
Go uuid 1/1 passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx passed ✅ PASS
Node.js execa passed ✅ PASS
Node.js p-limit passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

Generated by Build Test Suite for #6493 · 36.9 AIC · ⊞ 8.2K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

🔬 Smoke Test: Copilot PAT Auth — PR #6493

Test Result
GitHub MCP connectivity ✅ MCP reachable (secrecy policy filtered response)
GitHub.com HTTP ⚠️ Template vars not expanded (${{ steps.smoke-data.outputs.SMOKE_HTTP_CODE }})
File write/read ⚠️ Template vars not expanded

Overall: ⚠️ INCONCLUSIVE — pre-computed step outputs were not interpolated into the prompt.

Auth mode: PAT (COPILOT_GITHUB_TOKEN)

🔑 PAT report filed by Smoke Copilot PAT
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

@lpcox Smoke test results:\n- Pre-fetched PR Data ✅\n- GitHub.com connectivity ✅\n- File I/O ✅\n- BYOK mode via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) ✅\n\nOverall: PASS

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test Results

Overall Status: FAIL

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • localhost

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "localhost"

See Network Configuration for more information.

💎 Faceted by Smoke Gemini
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

🔬 Smoke Test Results (Docker Sbx)

Test Status
GitHub MCP Connectivity ✅ MCP server responded
GitHub.com HTTP ⚠️ Pre-step data unavailable (template vars not substituted)
File Write/Read ⚠️ Pre-step data unavailable (template vars not substituted)

Overall: PARTIAL — MCP connectivity verified; pre-computed test data was not injected into the workflow prompt.

cc @lpcox

📰 BREAKING: Report filed by Smoke Docker Sbx
Add label ready-for-aw to run again

@lpcox
lpcox disabled auto-merge July 22, 2026 17:34
@lpcox
lpcox merged commit 537b850 into main Jul 22, 2026
229 of 236 checks passed
@lpcox
lpcox deleted the test-coverage/container-startup-diagnostics-coverage-c99b95e83d0ec7d8 branch July 22, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants