Skip to content

[Test Coverage] src/docker-manager.ts - #6916

Merged
lpcox merged 3 commits into
mainfrom
test-coverage/host-env-1785834261-8e20dc347bc1c7d2
Aug 4, 2026
Merged

[Test Coverage] src/docker-manager.ts#6916
lpcox merged 3 commits into
mainfrom
test-coverage/host-env-1785834261-8e20dc347bc1c7d2

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds unit tests for src/host-env.ts, one of the modules re-exported by the src/docker-manager.ts barrel (target file: docker-manager.ts, currently ~18% covered). docker-manager.ts itself is only a re-export barrel with dedicated per-module test suites; this PR adds the missing suite for host-env.ts, which previously had no direct test file.

What's covered

  • hostEnvTestHelpers.subnetsOverlap (internal CIDR overlap helper): identical subnets, overlapping subnets with differing masks, disjoint subnets, adjacent-but-non-overlapping subnets, fully-contained subnets.
  • stripScheme: empty/whitespace input, scheme+path stripping, implicit scheme for bare hostnames, query/fragment stripping, credentials+port stripping, whitespace trimming, and the catch-fallback path for unparsable input.
  • parseDifcProxyHost: default host/port for empty/whitespace input, plain host:port, default port when omitted, IPv6 bracketed notation, scheme-prefix stripping, invalid/malformed value error path, port-zero validation error path, and whitespace trimming.

Testing

Ran the new suite in isolation:

./node_modules/.bin/jest --testPathPatterns='src/host-env.test.ts$' --no-coverage

All 22 tests pass (src/host-env.test.ts). No existing tests were modified.

Generated by Test Coverage Improver · auto · 43.9 AIC · ⊞ 9.2K ·

Covers subnetsOverlap, stripScheme, and parseDifcProxyHost including
edge cases: empty/whitespace input, invalid ports, IPv6 notation,
scheme stripping, and malformed URL fallback paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lpcox
lpcox marked this pull request as ready for review August 4, 2026 13:39
Copilot AI balanced review requested due to automatic review settings August 4, 2026 13:39

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 for host-env.ts helpers, but substantially duplicates existing suites.

Changes:

  • Tests subnet overlap detection.
  • Tests URL hostname normalization.
  • Tests DIFC proxy host parsing and validation.
Show a summary per file
File Description
src/host-env.test.ts Adds unit tests for host environment helpers.

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: 2
  • Review effort level: Balanced

Comment thread src/host-env.test.ts Outdated
// stripScheme, and parseDifcProxyHost. These are re-exported (in part) via
// the docker-manager.ts barrel module.

import { stripScheme, parseDifcProxyHost, hostEnvTestHelpers } from './host-env';
Comment thread src/host-env.test.ts Outdated
Comment on lines +1 to +3
// Tests for host-env.ts pure helper functions: subnetsOverlap (internal),
// stripScheme, and parseDifcProxyHost. These are re-exported (in part) via
// the docker-manager.ts barrel module.
@lpcox

lpcox commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Copilot AI commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

@copilot address review feedback

Addressed in 665c132: removed the duplicate src/host-env.test.ts and merged the genuinely new edge cases (query/fragment stripping, credentials+port stripping, whitespace trimming) into the existing docker-manager-string-utils.test.ts suite. All related suites pass.

Copilot AI requested a review from lpcox August 4, 2026 15:09
@github-actions

github-actions Bot commented Aug 4, 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 Aug 4, 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 Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

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

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Claude passed

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

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

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓

@github-actions

github-actions Bot commented Aug 4, 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 Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Gemini completed. All facets verified. 💎

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Contribution Check completed successfully!

No contribution-guideline issues found in PR #6916. The PR adds a focused test suite in the correct source/test location, includes testing notes in the description, and does not introduce documentation or organization concerns under CONTRIBUTING.md.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

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

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Aug 4, 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 Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Gemini completed. All facets verified. 💎

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Build Test Suite completed successfully!

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Claude passed

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

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

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

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

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓

@github-actions

github-actions Bot commented Aug 4, 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 Aug 4, 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 Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Test: Copilot BYOK (Direct) Mode ✅

Test Results:

Mode: Direct BYOK (COPILOT_PROVIDER_API_KEY) via api-proxy sidecar

Overall Status: PASS

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

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

EGRESS_RESULT allow=pass deny=pass

✅ Allowed domain (api.github.com) reachable — allowed=200
✅ Non-allowlisted domain (example.com) blocked — proxy 403

Overall: PASS

@lpcox network isolation egress enforcement verified inside AWF sandbox.

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 Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Test Results (Copilot Engine)

Overall: PASS

@lpcox — PR: [WIP] Fix token steering to respect explicit provider configuration

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

@github-actions

github-actions Bot commented Aug 4, 2026

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 #6916 · haiku45 · 55.7 AIC · ⊞ 3.6K ·
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Test: Services Connectivity

  • Redis PING: ❌ (Temporary failure in name resolution)
  • PostgreSQL pg_isready: ❌ (no response)
  • PostgreSQL SELECT 1: ❌ (could not translate host name)

Overall: FAILhost.docker.internal did not resolve inside the AWF sandbox.

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

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Gemini Smoke Test Results

Overall Status: FAIL

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

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Chroot Version Comparison

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.13 ✅ YES
Node.js v24.18.0 v22.23.1 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Overall: FAILED — Node.js version mismatch between host and chroot environments.

Tested by Smoke Chroot
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

📡 OTel Tracing Smoke Test Results

Scenario Result
1. Module Loading otel.js loaded successfully; isEnabled()true. Exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled, _parseEndpoints, _parseOtlpHeaders, _buildResourceSpans, plus internal exporter classes.
2. Test Suite ✅ 59/59 tests passed across 2 suites (otel.test.js, otel-fanout.test.js) — covers span creation, token/budget attributes, OTLP export (ProxyAwareOtlpExporter), file fallback, and fan-out.
3. Env Var Forwarding env-passthrough.ts forwards GITHUB_AW_OTEL_TRACE_ID and GITHUB_AW_OTEL_PARENT_SPAN_ID to the agent (trace context only, no credentials). api-proxy-env-config.ts forwards GH_AW_OTLP_ENDPOINTS, OTEL_EXPORTER_OTLP_ENDPOINT, plus both trace context vars into the api-proxy.
4. Token Tracker Integration token-tracker-http.js contains the onUsage callback hook point used for OTEL gen_ai.usage.* attribute population.
5. OTEL Diagnostics ✅ Run-time token usage tracking active (7 records observed in token-usage.jsonl, e.g. gen_ai input/output/cache tokens and AI-credit costs). No local otel.jsonl file appeared in sandbox logs this run since spans export directly to the configured Sentry OTLP endpoint rather than the local file exporter — expected per fan-out priority (GH_AW_OTLP_ENDPOINTS configured → remote export, not FileSpanExporter).

Overall: All 5 scenarios passed. No regressions detected in OTEL tracing integration.

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

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@lpcox

  • Fix token steering to respect explicit provider configuration: ✅
  • Propagate boundedAgents config fields to CLI mapping spec: ✅
  • GitHub.com connectivity: ✅
  • File write/read test: ✅
  • BYOK inference test: ✅
    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

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Smoke test results:

  • GitHub merged PRs reviewed: [WIP] Fix token steering to respect explicit provider configuration; [WIP] Add cloud Workload Identity Federation exchange for OTLP export auth
  • GitHub PR query checked: same 2 titles returned
  • Playwright GitHub title check ✅
  • Temp file write/read check ✅
  • Build check ❌ (npm unavailable here)
  • Discussion lookup found #6931, but discussion commenting is unavailable in this workflow
  • Overall status: FAIL

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

@github-actions

github-actions Bot commented Aug 4, 2026

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 (run OK) ✅ PASS
.NET json-parse N/A (run OK) ✅ PASS
Go color ok ✅ PASS
Go env ok ✅ PASS
Go uuid ok ✅ 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

Note: Java Maven builds initially failed with a LocalRepositoryNotAccessibleException due to ~/.m2/repository permission restrictions in this sandbox (unrelated to firewall/network config); resolved locally with -Dmaven.repo.local override, after which all Java builds/tests succeeded normally through the Squid proxy.

Generated by Build Test Suite for #6916 · auto · 41.6 AIC · ⊞ 11.5K ·
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@lpcox

  • Pre-fetched PR data: ✅
  • GitHub.com connectivity: ✅
  • File write/read: ✅
  • BYOK inference: ✅

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)

PASS

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

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Test: Docker Sbx Validation

  • MCP connectivity: ✅
  • GitHub.com HTTP: ✅ (200)
  • File write/read: ✅

Overall: PASS

cc PR author/assignees

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

@lpcox
lpcox merged commit 3201f1d into main Aug 4, 2026
138 of 139 checks passed
@lpcox
lpcox deleted the test-coverage/host-env-1785834261-8e20dc347bc1c7d2 branch August 4, 2026 23:09
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