Skip to content

Split squid config tests by concern#5575

Merged
lpcox merged 2 commits into
mainfrom
copilot/refactor-split-squid-config-tests
Jun 26, 2026
Merged

Split squid config tests by concern#5575
lpcox merged 2 commits into
mainfrom
copilot/refactor-split-squid-config-tests

Conversation

Copilot AI commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

src/squid-config.test.ts had grown into a mixed-responsibility file covering both generateSquidConfig and generatePolicyManifest, with the policy manifest cases split across separate top-level suites. This change separates those concerns so domain allowlist tests, policy manifest coverage, and API-proxy manifest rules are independently discoverable and easier to run in isolation.

  • What changed

    • Replaced the single src/squid-config.test.ts file with three focused suites:
      • src/squid-config-core.test.ts
      • src/squid-config-policy.test.ts
      • src/squid-config-policy-api-proxy.test.ts
  • Suite boundaries

    • Core Squid config
      • Moved generateSquidConfig coverage for config structure, real-world domain patterns, and protocol rule ordering into src/squid-config-core.test.ts
    • Policy manifest
      • Consolidated the main generatePolicyManifest coverage into src/squid-config-policy.test.ts
      • Kept upstream proxy and api-proxy sidecar config assertions with the broader policy-manifest suite
    • API-proxy manifest rules
      • Isolated the focused generatePolicyManifest API-proxy rule-ordering cases into src/squid-config-policy-api-proxy.test.ts
  • Result

    • Domain-ACL regressions are now immediately findable without scanning through policy-manifest cases
    • Policy manifest behavior remains grouped together, while the narrow API-proxy manifest ordering checks can be targeted independently
// Before
src/squid-config.test.ts

// After
src/squid-config-core.test.ts
src/squid-config-policy.test.ts
src/squid-config-policy-api-proxy.test.ts

Copilot AI changed the title [WIP] Refactor squid-config.test.ts by splitting tests for concerns Split squid config tests by concern Jun 26, 2026
Copilot AI requested a review from lpcox June 26, 2026 15:57
Copilot finished work on behalf of lpcox June 26, 2026 15:57
@lpcox lpcox marked this pull request as ready for review June 26, 2026 16:37
Copilot AI review requested due to automatic review settings June 26, 2026 16:37

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 improves test organization for Squid configuration and policy-manifest generation by splitting a previously mixed-responsibility suite into focused, independently runnable test files.

Changes:

  • Split generateSquidConfig coverage into a dedicated core suite (src/squid-config-core.test.ts).
  • Consolidated generatePolicyManifest coverage in src/squid-config-policy.test.ts, removing unrelated top-level suites.
  • Moved API-proxy-specific policy-manifest rule-order tests into src/squid-config-policy-api-proxy.test.ts.
Show a summary per file
File Description
src/squid-config-policy.test.ts Removes unrelated suites so this file focuses on policy-manifest behavior (and related config assertions).
src/squid-config-policy-api-proxy.test.ts Adds isolated tests for API-proxy policy-manifest rule presence/order.
src/squid-config-core.test.ts Adds focused tests for core Squid config generation (structure, domain patterns, rule ordering).
src/squid-config.test.ts Removed in favor of the three focused suites above.

Review details

Tip

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

  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Low

@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@copilot Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

github-actions Bot commented Jun 26, 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 Jun 26, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jun 26, 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 Jun 26, 2026

Copy link
Copy Markdown
Contributor

Contribution Check completed successfully!

Contribution check complete for PR #5575: changes are a test-only refactor with focused suites under src/, clear PR description, no documentation needed, and no important CONTRIBUTING.md gaps found.

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Smoke Gemini completed. All facets verified. 💎

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Smoke Claude passed

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Build Test Suite completed successfully!

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 98.24% 98.28% 📈 +0.04%
Statements 98.17% 98.21% 📈 +0.04%
Functions 99.53% 99.53% ➡️ +0.00%
Branches 94.00% 94.00% ➡️ +0.00%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/workdir-setup.ts 92.7% → 94.5% (+1.82%) 92.7% → 94.5% (+1.82%)

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

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

  • API status: ✅ PASS
  • gh check: ✅ PASS
  • File status: ✅ PASS

Overall result: PASS

Generated by Smoke Claude for issue #5575 · 61.4 AIC · ⊞ 3.3K ·

@github-actions

Copy link
Copy Markdown
Contributor

🔬 Smoke Test Results

PR: Split squid config tests by concern
Author: @Copilot | Assignees: @lpcox, @Copilot

Test Result
GitHub MCP connectivity
GitHub.com HTTP connectivity ❌ pre-step data unavailable
File write/read ❌ pre-step data unavailable

Overall: FAIL — pre-step outputs were not resolved (template variables unset).

📰 BREAKING: Report filed by Smoke Copilot

@github-actions github-actions Bot mentioned this pull request Jun 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔥 Smoke Test: Copilot PAT — PASS

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

Overall: PASS · Auth mode: PAT (COPILOT_GITHUB_TOKEN)

/cc @lpcox @Copilot

🔑 PAT report filed by Smoke Copilot PAT

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smoke Test: API Proxy OpenTelemetry Tracing

Scenario Result Notes
S1: Module Loading otel.js loads; exports 7 public functions: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled
S2: Test Suite 39/39 tests pass in otel.test.js (span creation, token attrs, parent context, exporters, shutdown)
S3: 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 to api-proxy container
S4: Token Tracker Integration token-tracker-http.js finalizeHttpTracking() invokes onUsage callback (line 324) and onSpanEnd callback as the OTEL hook points
S5: OTEL Diagnostics No endpoint configured → graceful degradation to FileSpanExporter fallback (/var/log/api-proxy/otel.jsonl); isEnabled() returns true; no errors

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

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions

Copy link
Copy Markdown
Contributor

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

Test Results:

  • ✅ GitHub MCP connectivity: Listed merged PRs
  • ✅ GitHub.com connectivity: HTTP 200
  • ✅ File write/read: Confirmed
  • ✅ BYOK inference: Running via api-proxy → api.githubcopilot.com

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

PR: Split squid config tests by concern (@lpcox, @Copilot)

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results

  • GitHub MCP Testing: ❌ (Tools unreachable)
  • GitHub.com Connectivity: ❌ (000/Exit 35)
  • 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

@github-actions

Copy link
Copy Markdown
Contributor

Split squid config tests by concern

Merged PRs:

Checks:

  • GitHub reads: ✅
  • Playwright title: ✅
  • File write/read: ✅
  • Discussion comment: ✅
  • 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

@github-actions

Copy link
Copy Markdown
Contributor

@Copilot @lpcox

Smoke Test Results:

  • GitHub MCP: ✅
  • GitHub.com Connectivity: ✅
  • File I/O: ✅
  • BYOK Inference: ✅

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

Overall: PASS

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Version Comparison Results

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.3
Node.js v24.17.0 v22.23.0
Go go1.22.12 go1.22.12

Overall: ❌ Not all tests passed

  • Python and Node.js versions differ between host and chroot environments
  • Go versions match

Tested by Smoke Chroot

@github-actions

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

Generated by Build Test Suite for issue #5575 · 42.2 AIC · ⊞ 7.8K ·

@github-actions

Copy link
Copy Markdown
Contributor

@lpcox @Copilot Smoke test results:

  • GitHub MCP testing: ✅
  • GitHub.com connectivity: ✅
  • File write/read: ✅
  • BYOK inference: ✅

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

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Services Connectivity

Check Result
Redis PING (host.docker.internal:6379) ❌ Timeout
PostgreSQL pg_isready (host.docker.internal:5432) ❌ Timeout
PostgreSQL SELECT 1 ❌ Timeout

Overall: FAIL

host.docker.internal resolves to 172.17.0.1, but both ports timed out. AWF iptables rules block database/Redis ports (5432, 6379) by design — service containers on the host are not reachable from inside the AWF sandbox.

🔌 Service connectivity validated by Smoke Services

@lpcox lpcox merged commit 631ba64 into main Jun 26, 2026
88 of 92 checks passed
@lpcox lpcox deleted the copilot/refactor-split-squid-config-tests branch June 26, 2026 19:34
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