Skip to content

refactor: split coverage-improvements.test.ts into per-module test files#6036

Merged
lpcox merged 3 commits into
mainfrom
copilot/refactor-split-coverage-improvements-tests
Jul 9, 2026
Merged

refactor: split coverage-improvements.test.ts into per-module test files#6036
lpcox merged 3 commits into
mainfrom
copilot/refactor-split-coverage-improvements-tests

Conversation

Copilot AI commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

src/coverage-improvements.test.ts was a 651-line catch-all accumulating branch-coverage tests for four unrelated modules, making failures hard to localize and new tests hard to place.

Changes

  • Deleted src/coverage-improvements.test.ts
  • Created four focused replacements, each co-located with the module it covers:
File Module
src/logs/log-parser-branches.test.ts src/logs/log-parser.ts
src/workdir-setup-branches.test.ts src/workdir-setup.ts
src/commands/network-setup-branches.test.ts src/commands/network-setup.ts
src/domain-validation-branches.test.ts src/commands/preflight.ts / src/domain-validation.ts

No production code changed. All 30 tests pass. Jest discovers the new files automatically via existing glob patterns — no config changes needed.

- src/logs/log-parser-branches.test.ts (~160 lines)
- src/workdir-setup-branches.test.ts (~195 lines)
- src/commands/network-setup-branches.test.ts (~95 lines)
- src/domain-validation-branches.test.ts (~135 lines)

All 30 tests pass. Closes #6011
Copilot AI changed the title [WIP] Refactor coverage improvements tests into separate files refactor: split coverage-improvements.test.ts into per-module test files Jul 9, 2026
Copilot AI requested a review from lpcox July 9, 2026 02:45
Copilot finished work on behalf of lpcox July 9, 2026 02:45
@lpcox lpcox marked this pull request as ready for review July 9, 2026 02:56
Copilot AI review requested due to automatic review settings July 9, 2026 02:56

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

This PR refactors the previously monolithic src/coverage-improvements.test.ts into smaller, module-focused branch-coverage test files co-located with the code they exercise, improving failure localization and test maintainability without changing production behavior.

Changes:

  • Deleted src/coverage-improvements.test.ts (651 lines) to remove the catch-all coverage file.
  • Added four per-module “*-branches.test.ts” files that preserve the prior branch-coverage intent while making ownership and placement clearer.
  • Kept Jest discovery behavior unchanged by using existing **/*.test.ts naming/globs.
Show a summary per file
File Description
src/workdir-setup-branches.test.ts Adds targeted branch-coverage tests for src/workdir-setup.ts error/else branches and chroot-home warning behavior.
src/logs/log-parser-branches.test.ts Adds targeted branch-coverage tests for src/logs/log-parser.ts parsing edge cases.
src/domain-validation-branches.test.ts Adds targeted branch-coverage tests around preflight domain allow/block resolution behavior with mocked validators/parsers.
src/commands/network-setup-branches.test.ts Adds targeted branch-coverage tests for src/commands/network-setup.ts error and env-branch handling.
src/coverage-improvements.test.ts Removes the previous aggregated coverage test file in favor of focused replacements.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 5/5 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment thread src/workdir-setup-branches.test.ts
Comment thread src/workdir-setup-branches.test.ts
@lpcox

lpcox commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Copilot AI commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address review feedback

Fixed in 68aeb31. Both afterEach blocks in src/workdir-setup-branches.test.ts now also call fs.rmSync(\${tempDir}-chroot-home`, { recursive: true, force: true })to clean up the sibling directory thatprepareWorkDirectories()` creates.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Smoke Gemini completed. All facets verified. 💎

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Contribution Check failed. Please review the logs for details.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Smoke Claude passed

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Build Test Suite completed successfully!

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 98.98% 99.01% 📈 +0.03%
Statements 98.94% 98.98% 📈 +0.04%
Functions 99.44% 99.44% ➡️ +0.00%
Branches 95.64% 95.64% ➡️ +0.00%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/workdir-setup.ts 98.0% → 99.3% (+1.33%) 98.0% → 99.3% (+1.32%)

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

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

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

Overall result: PASS

Warning

Firewall blocked 1 domain

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

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by Smoke Claude for #6036 · 35.1 AIC · ⊞ 3.3K ·
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Services Connectivity

  • Redis PING: ❌ Network is unreachable
  • PostgreSQL pg_isready: ❌ No response
  • PostgreSQL SELECT 1: ❌ Network is unreachable

Overall: FAIL

host.docker.internal resolves to 172.17.0.1 but is unreachable from this sandbox.

Warning

Firewall blocked 1 domain

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

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

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

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🔍 Smoke Test Results

Test Status
GitHub MCP connectivity ✅ Pass
GitHub.com HTTP ⚠️ Pre-step data not injected
File write/read ⚠️ Pre-step data not injected

Overall: PASS (MCP connected; CI template vars not substituted for other checks)

CC @lpcox

Warning

Firewall blocked 1 domain

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

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

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

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK Mode

Test Results:

  • ✅ GitHub.com connectivity (HTTP 200)
  • ✅ File write/read test
  • ✅ BYOK inference path active (direct mode via api-proxy → api.githubcopilot.com)
  • i️ Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY set)

Status: PASS

Warning

Firewall blocked 1 domain

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

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

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

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Chroot Version Comparison

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

Result: Not all versions matched. Go matches, but Python (3.12.13 vs 3.12.3) and Node.js (v24.18.0 vs v22.23.1) differ between host and chroot environments.

Warning

Firewall blocked 1 domain

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

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

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

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Gemini Engine Validation

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

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: API Proxy OpenTelemetry Tracing

Scenario Status Notes
1. Module Loading ✅ Pass otel.js loads; exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled
2. Test Suite ✅ Pass 59 tests passed, 2 suites (otel.test.js, otel-fanout.test.js)
3. Env Var Forwarding ⚠️ Pending OTEL_EXPORTER_OTLP_ENDPOINT/GITHUB_AW_OTEL_TRACE_ID not yet forwarded in src/services/api-proxy-service.ts — expected during development
4. Token Tracker Integration ✅ Pass onUsage callback exists in token-tracker-http.js
5. OTEL Diagnostics i️ N/A No live api-proxy run; GITHUB_AW_OTEL_TRACE_ID and GITHUB_AW_OTEL_PARENT_SPAN_ID env vars confirmed present in workflow environment

Summary: Core OTEL module and test suite are working correctly. Env var forwarding to the api-proxy container is the remaining expected-pending item for development completion.

Warning

Firewall blocked 1 domain

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

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

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

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🔬 Smoke Test: Copilot PAT Auth

Test Result
GitHub MCP connectivity
GitHub.com HTTP ✅ 200
File write/read

Overall: PASS | Auth mode: PAT (COPILOT_GITHUB_TOKEN)
Author: @lpcox

Warning

Firewall blocked 1 domain

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

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

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

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🏗️ 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 all passed ✅ PASS
Node.js execa all passed ✅ PASS
Node.js p-limit all passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

Warning

Firewall blocked 1 domain

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

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by Build Test Suite for #6036 · 80.2 AIC · ⊞ 6.9K ·
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Smoke Test

  • fix: use tag-only image ref in rootless permission repair
  • chore: upgrade gh-aw extension to v0.82.5 pre-release
  • GitHub title check ✅
  • File write/read ✅
  • Build ✅
  • Overall status: PASS

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • awmgmcpg
  • registry.npmjs.org

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

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

See Network Configuration for more information.

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

@lpcox lpcox merged commit 46ad194 into main Jul 9, 2026
85 of 88 checks passed
@lpcox lpcox deleted the copilot/refactor-split-coverage-improvements-tests branch July 9, 2026 03:38
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.

[Refactoring] Split coverage-improvements.test.ts into per-module test files

3 participants