Skip to content

[WIP] Refactor audit enricher tests to remove duplicate policy fixture builders#5370

Merged
lpcox merged 2 commits into
mainfrom
copilot/audit-enricher-duplicate-test-fix
Jun 22, 2026
Merged

[WIP] Refactor audit enricher tests to remove duplicate policy fixture builders#5370
lpcox merged 2 commits into
mainfrom
copilot/audit-enricher-duplicate-test-fix

Conversation

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown
Contributor
  • Create src/logs/audit-enricher.test-utils.ts with shared makeEntry and makeManifest exports
  • Update audit-enricher.test.ts to remove local duplicates and import from shared file
  • Update audit-enricher-extra.test.ts to remove local duplicates and import from shared file
  • Run tests to verify no regressions (24/24 pass)

Copilot AI requested a review from lpcox June 22, 2026 03:30
@lpcox
lpcox marked this pull request as ready for review June 22, 2026 13:35
Copilot AI review requested due to automatic review settings June 22, 2026 13:35

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 audit enricher unit tests by centralizing duplicated policy/log-entry fixture builders into a shared test utility module, reducing repetition across the audit-enricher test suites.

Changes:

  • Added src/logs/audit-enricher.test-utils.ts to provide shared makeEntry and makeManifest helpers.
  • Updated audit-enricher.test.ts and audit-enricher-extra.test.ts to import the shared helpers and remove local duplicates.
Show a summary per file
File Description
src/logs/audit-enricher.test.ts Removes local fixture builders and reuses shared makeEntry/makeManifest for consistent test setup.
src/logs/audit-enricher.test-utils.ts Introduces shared test-only fixture builders for audit enricher tests.
src/logs/audit-enricher-extra.test.ts Removes duplicated fixture builders and imports shared utilities to reduce maintenance overhead.

Copilot's findings

Tip

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

  • Files reviewed: 3/3 changed files
  • Comments generated: 0

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Build Test Suite completed successfully!

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Smoke Gemini completed. All facets verified. 💎

@github-actions

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

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

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

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Smoke Claude passed

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Jun 22, 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 97.85% 97.89% 📈 +0.04%
Statements 97.79% 97.83% 📈 +0.04%
Functions 99.50% 99.51% 📈 +0.01%
Branches 93.55% 93.55% ➡️ +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%)
✨ New Files (1 files)
  • src/logs/audit-enricher.test-utils.ts: 100.0% lines

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

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct Mode) ✅ PASS

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

Mode: Direct BYOK (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com

All systems operational.

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

Copy link
Copy Markdown
Contributor

🔥 Smoke Test Results

PR: [WIP] Refactor audit enricher tests to remove duplicate policy fixture builders
Author: @Copilot | Assignees: @lpcox @Copilot

Test Result
GitHub MCP connectivity
GitHub.com connectivity (HTTP 200)
File write/read ❌ (template vars unsubstituted)
Pre-fetched PR data ❌ (template vars unsubstituted)

Overall: FAIL — workflow template substitution did not occur for pre-step outputs.

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

Copy link
Copy Markdown
Contributor

Smoke test status: FAIL

  • Split docker-manager cleanup tests by concern
  • Split api-proxy token parser tests by JSON, SSE, and normalization concerns
  • safeinputs-gh unavailable
  • Browser title, file write/read, discussion lookup, and build: 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

Smoke Test: Claude Engine Validation

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

Overall result: PASS

Generated by Smoke Claude for issue #5370 · 36.6 AIC · ⊞ 3.1K ·

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: API Proxy OpenTelemetry Tracing

Scenario Result Notes
1. Module Loading otel.js loaded; exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled + internal helpers
2. Test Suite 59/59 tests pass across 2 suites (otel.test.js, otel-fanout.test.js)
3. Env Var Forwarding buildOtelEnvironment() in observability-environment.ts forwards all OTEL_* vars; api-proxy-service-config.ts explicitly passes OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, GITHUB_AW_OTEL_TRACE_ID, GITHUB_AW_OTEL_PARENT_SPAN_ID
4. Token Tracker Integration onUsage callback present at line 283/324 of token-tracker-http.js
5. OTEL Diagnostics Graceful degradation confirmed — _FileSpanExporter writes to /var/log/api-proxy/otel.jsonl when no OTLP endpoint configured

All scenarios pass. OTEL integration is fully functional.

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions

Copy link
Copy Markdown
Contributor

🔥 Smoke Test Results — Auth mode: PAT (COPILOT_GITHUB_TOKEN)

Test Result
GitHub MCP connectivity ✅ PR data fetched (PR #5357)
GitHub.com HTTP ✅ HTTP 200
File write/read ✅ Verified

Overall: PASS

cc @lpcox @Copilot

🔑 PAT report filed by Smoke Copilot PAT

@github-actions

Copy link
Copy Markdown
Contributor

@Copilot @lpcox Smoke Test PASS

  • GitHub MCP Testing: ✅
  • GitHub.com Connectivity: ✅
  • File Write/Read Test: ✅
  • BYOK Inference Test: ✅

Running direct BYOK via api-proxy to Azure OpenAI (Foundry, o4-mini-aw) with Microsoft Entra authentication.

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

@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 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 issue #5370 · 42 AIC · ⊞ 7.7K ·

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Version Comparison Results

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

Overall: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot environments.

Tested by Smoke Chroot

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results — Services Connectivity

host.docker.internal resolves to 172.17.0.1 but all service connections timed out.

Check Result
Redis PING ❌ timeout
PostgreSQL pg_isready ❌ no response
PostgreSQL SELECT 1 ❌ timeout

Overall: FAIL

Services are not reachable from within the AWF sandbox on host.docker.internal:6379 or host.docker.internal:5432.

🔌 Service connectivity validated by Smoke Services

@github-actions

Copy link
Copy Markdown
Contributor

Gemini Smoke Test Results

  • GitHub MCP Testing: ✅
  • GitHub.com Connectivity: ✅
  • File Writing Testing: ✅
  • Bash Tool Testing: ✅

Overall status: PASS

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

@lpcox
lpcox merged commit 3dc60b3 into main Jun 22, 2026
85 of 89 checks passed
@lpcox
lpcox deleted the copilot/audit-enricher-duplicate-test-fix branch June 22, 2026 15:09
Copilot finished work on behalf of lpcox July 2, 2026 03:22
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