Skip to content

[Test Coverage] fix: dns-preresolution test fails on runners with github.com in /etc/hosts#6522

Merged
lpcox merged 1 commit into
mainfrom
fix/dns-preresolution-test-runner-hosts-e3a52de0f1b7aa18
Jul 23, 2026
Merged

[Test Coverage] fix: dns-preresolution test fails on runners with github.com in /etc/hosts#6522
lpcox merged 1 commit into
mainfrom
fix/dns-preresolution-test-runner-hosts-e3a52de0f1b7aa18

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Problem

The agent-volumes-dns-preresolution.test.ts test was consistently failing on GitHub Actions runners because it used github.com and npmjs.org as test domains. These domains are injected into the runner's /etc/hosts file by GitHub.

The hosts-file.ts generator skips domains already present in /etc/hosts (to avoid duplicates), so the execa.sync mock for getent was never invoked for these domains. This caused the assertions on specific resolved IPs to fail:

expect(content).toContain('140.82.121.4\tgithub.com');  // FAIL — github.com skipped

Fix

Replace github.com / npmjs.org with synthetic .internal domain names (awf-test-alpha.internal, awf-test-beta.internal) that can never appear in a runner's /etc/hosts. This makes the test fully environment-independent.

Verification

PASS src/services/agent-volumes-dns-preresolution.test.ts
  agent service
    ✓ should pre-resolve allowed domains into chroot-hosts file (8 ms)
    ✓ should skip domains that fail to resolve during pre-resolution (1 ms)
    ✓ should not add duplicate entries for domains already in /etc/hosts (1 ms)

Generated by Test Coverage Improver · 58.6 AIC · ⊞ 6.3K ·

The test was using 'github.com' and 'npmjs.org' which are injected into
/etc/hosts on GitHub Actions runners. The hosts-file generator skips
domains already present in /etc/hosts, so the pre-resolution mock was
never called and the assertions on specific IPs failed.

Replace with synthetic .internal domain names that cannot appear in any
runner's /etc/hosts, making the test environment-independent.

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

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

Makes DNS pre-resolution tests independent of GitHub-hosted runner /etc/hosts entries.

Changes:

  • Replaces public domains with synthetic .internal test domains.
  • Updates mocked DNS responses and assertions accordingly.
Show a summary per file
File Description
src/services/agent-volumes-dns-preresolution.test.ts Uses environment-safe synthetic domains in pre-resolution tests.

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: 0
  • Review effort level: Medium

@github-actions

github-actions Bot commented Jul 23, 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 23, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Gemini completed. All facets verified. 💎

Smoke test completed with partial failures: MCP titles filtered, connectivity failed.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

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

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

🔌 Smoke Services — Service connectivity failed to deliver outputs ⚠️

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Claude passed

@github-actions

github-actions Bot commented Jul 23, 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 Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

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

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

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

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Contribution Check completed successfully!

Contribution check complete: the PR follows the visible guidelines. It adds/updates a targeted test, keeps the change in the correct source tree, and the PR description clearly explains the failure and fix. No comment needed.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Build Test Suite completed successfully!

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

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

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...

@github-actions

Copy link
Copy Markdown
Contributor Author

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Jul 23, 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 23, 2026

Copy link
Copy Markdown
Contributor Author

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

@github-actions

Copy link
Copy Markdown
Contributor Author

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 98.96% 98.99% 📈 +0.03%
Statements 98.88% 98.91% 📈 +0.03%
Functions 99.41% 99.41% ➡️ +0.00%
Branches 95.30% 95.30% ➡️ +0.00%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

@github-actions

Copy link
Copy Markdown
Contributor Author

@lpcox — Smoke test: Copilot Network Isolation Egress Enforcement

EGRESS_RESULT allow=pass deny=pass

✅ Allowed domain (api.github.com): HTTP 200
✅ Blocked domain (example.com): connection denied (403 from 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 added the smoke-copilot-network-isolation Copilot network-isolation egress smoke test label Jul 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor Author

🧪 Smoke Test: Copilot PAT Auth — PASS

Test Result
GitHub MCP connectivity
GitHub.com HTTP connectivity
File write/read ✅ (smoke-test-copilot-pat-30014326468.txt confirmed)

Overall: PASS | 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

🔬 Smoke Test Results

Test Status
GitHub MCP connectivity ⚠️ Filtered by secrecy policy
GitHub.com connectivity ✅ HTTP 200
File write/read ⚠️ Pre-step variables not expanded

Overall: PARTIAL — Core connectivity passing; pre-step data unavailable (template variables not expanded in agent context).

cc @lpcox

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

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test: Copilot BYOK (Direct) ✅ PASS

✅ MCP connectivity (github-list_pull_requests)
✅ GitHub.com connectivity (HTTP 200)
✅ File write/read test (smoke-test-copilot-byok.txt)
✅ BYOK inference path operational

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com

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

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test Results

  • PR titles: Filtered by secrecy policy
  • GitHub MCP Testing: ❌
  • GitHub.com Connectivity: ❌
  • File Writing Testing: ✅
  • Bash Tool Testing: ✅

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: Claude Engine Validation

Check Result
API Status ✅ PASS
GH Check ✅ PASS
File Status ✅ PASS

Overall Result: PASS

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

@github-actions

Copy link
Copy Markdown
Contributor Author

🔬 Smoke Test: API Proxy OpenTelemetry Tracing

Scenario Result Notes
1. Module Loading otel.js loads successfully; exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled
2. Test Suite 59 tests passed, 0 failed (otel.test.js + otel-fanout.test.js)
3. Env Var Forwarding src/services/api-proxy-env-config.ts forwards OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, OTEL_SERVICE_NAME (confirmed by api-proxy-env-config.test.ts)
4. Token Tracker Integration onUsage callback exists in token-tracker-http.js (lines 328, 386) as the OTEL hook point
5. OTEL Diagnostics No OTLP endpoint configured in this run; gracefully falls back to FileSpanExporter at /var/log/api-proxy/otel.jsonl. isEnabled() returns true in both modes.

All scenarios pass. ✅

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

@github-actions

Copy link
Copy Markdown
Contributor Author

Chroot Version Comparison Results

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 (host: v24.18.0, chroot: v22.23.1).

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

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test Results

  • Redis PING: ❌ (host.docker.internal name resolution failed)
  • PostgreSQL pg_isready: ❌ (no response)
  • PostgreSQL SELECT 1: ❌ (name 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

Copy link
Copy Markdown
Contributor Author

Smoke test: PASS

  • fix(api-proxy): track token usage for aborted streaming responses — ✅
  • Retry gVisor agent startup crashes once before failing — ✅
  • GitHub title check — ✅
  • File write/read — ✅
  • Build — ✅
    Overall: PASS

Warning

Firewall blocked 1 domain

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

  • registry.npmjs.org

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

network:
  allowed:
    - defaults
    - "registry.npmjs.org"

See Network Configuration for more information.

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

@github-actions

Copy link
Copy Markdown
Contributor Author

@lpcox
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

GitHub MCP connectivity: ❌ (Resource integrity policy prevented reading PR data)
GitHub.com connectivity: ✅
File write/read: ✅
BYOK inference: ✅

Overall: FAIL

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

@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 passed ✅ PASS
Go env passed ✅ PASS
Go uuid 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

Note on Java: Maven's default local repository (~/.m2/repository) was owned by root (no write permission). Tests ran successfully using -Dmaven.repo.local=/tmp/gh-aw/agent/m2repo as a workaround.

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

@github-actions

Copy link
Copy Markdown
Contributor Author

🔥 Smoke Test: Docker Sbx — PASS

Test Result
GitHub MCP connectivity
GitHub.com HTTP ✅ 200
File write/read Smoke test passed for Docker Sbx at Thu Jul 23 14:08:04 UTC 2026

Overall: ✅ PASS

cc @lpcox

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

@lpcox
lpcox merged commit 5674a8f into main Jul 23, 2026
140 of 143 checks passed
@lpcox
lpcox deleted the fix/dns-preresolution-test-runner-hosts-e3a52de0f1b7aa18 branch July 23, 2026 15:02
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.

2 participants