Skip to content

fix: export missing symbols required by tests#5685

Merged
lpcox merged 2 commits into
mainfrom
fix/failing-test-imports
Jun 29, 2026
Merged

fix: export missing symbols required by tests#5685
lpcox merged 2 commits into
mainfrom
fix/failing-test-imports

Conversation

@lpcox

@lpcox lpcox commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes 2 failing test suites on main caused by missing exports/imports:

src/ssl-key-storage.test.ts

  • Problem: Test imports secureWipeFile but it was not exported from ssl-key-storage.ts
  • Fix: Add export keyword to secureWipeFile function

src/services/api-proxy-service-split.test.ts

  • Problem: Test uses buildProviderTargetEnv but it was neither exported from its module nor imported in the test file
  • Fix: Export buildProviderTargetEnv from api-proxy-env-config.ts and add the import to the test file

Verification

All 200 test suites (3321 tests) pass after these changes.

- Export secureWipeFile from ssl-key-storage.ts (test imports it)
- Export buildProviderTargetEnv from api-proxy-env-config.ts (test uses it)
- Add missing import of buildProviderTargetEnv in api-proxy-service-split.test.ts

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 29, 2026 16:20
@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 98.14% 98.41% 📈 +0.27%
Statements 98.08% 98.34% 📈 +0.26%
Functions 99.54% 99.54% ➡️ +0.00%
Branches 94.14% 94.43% 📈 +0.29%
📁 Per-file Coverage Changes (5 files)
File Lines (Before → After) Statements (Before → After)
src/workdir-setup.ts 92.7% → 94.5% (+1.82%) 92.7% → 94.5% (+1.82%)
src/services/api-proxy-service-config.ts 93.3% → 100.0% (+6.67%) 93.3% → 100.0% (+6.67%)
src/services/api-proxy-credential-env.ts 92.8% → 100.0% (+7.15%) 92.8% → 100.0% (+7.15%)
src/ssl-key-storage.ts 86.4% → 100.0% (+13.64%) 86.4% → 100.0% (+13.64%)
src/services/api-proxy-lifecycle-config.ts 80.0% → 100.0% (+20.00%) 80.0% → 100.0% (+20.00%)

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

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 fixes failing unit tests on main by exporting two previously-internal helpers that tests import directly, restoring the intended test/module contract.

Changes:

  • Export secureWipeFile from src/ssl-key-storage.ts so ssl-key-storage.test.ts can import it.
  • Export buildProviderTargetEnv from src/services/api-proxy-env-config.ts and import it in api-proxy-service-split.test.ts.
Show a summary per file
File Description
src/ssl-key-storage.ts Exports secureWipeFile to satisfy test imports.
src/services/api-proxy-service-split.test.ts Adds missing import for buildProviderTargetEnv.
src/services/api-proxy-env-config.ts Exports buildProviderTargetEnv so tests can call it directly.

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

Comment thread src/ssl-key-storage.ts
Comment thread src/services/api-proxy-env-config.ts
@lpcox

lpcox commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot address review feedback

Copilot AI commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

@copilot address review feedback

Addressed in 56fb1bd: added @internal Exported for testing annotations to both test-driven exports (secureWipeFile and buildProviderTargetEnv) to keep them clearly out of the supported public API surface.

@github-actions

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

Copy link
Copy Markdown
Contributor

Smoke Gemini completed. All facets verified. 💎

Validation check

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

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

Smoke test started: gathering repo context and preparing required checks.

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Build Test Suite completed successfully!

@github-actions

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

Copy link
Copy Markdown
Contributor

Smoke Claude passed

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Contribution Check completed successfully!

Contribution guidelines review complete for PR #5685. No comment needed: the PR description is clear, changes are test-related, no new functionality requires documentation, and files remain in appropriate src locations.

@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 #5685 · 58.2 AIC · ⊞ 6.1K ·

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results — Auth mode: PAT (COPILOT_GITHUB_TOKEN)

Test Result
GitHub MCP connectivity
GitHub.com HTTP reachability ✅ (200)
File write/read (pre-step) ❌ (pre-step outputs not expanded — workflow config issue)

Overall: FAIL — file test unverifiable due to unexpanded template variables.

PR: "fix: export missing symbols required by tests" — author: @lpcox

🔑 PAT report filed by Smoke Copilot PAT

@github-actions

Copy link
Copy Markdown
Contributor

@lpcox

PRs:

  • fix: export missing symbols required by tests
  • fix: correctly recover runner tool on PATH (after sudo w/ secure_path). remove incorrect reading from GITHUB_PATH

✅ GitHub MCP Testing
✅ 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)

Overall: PASS

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

@github-actions

Copy link
Copy Markdown
Contributor

🔬 Smoke Test Results

Test Result
GitHub MCP connectivity
GitHub.com HTTP ✅ (200)
File write/read ❌ (pre-step template vars not substituted)

PR: fix: export missing symbols required by tests
Author: @lpcox

Overall: ❌ FAIL

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

Copy link
Copy Markdown
Contributor

fix: export missing symbols required by tests\nRemove unused export from API proxy env config\nStop keyword leakage in export surface\nGitHub reads: ✅\nPlaywright: ✅\nFile write/read: ✅\nDiscussion comment: ✅\nBuild: ✅\nOverall: 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: API Proxy OpenTelemetry Tracing

Scenario Result Notes
1. Module Loading ✅ Pass otel.js loads; isEnabled()=true; exports startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled
2. Test Suite ✅ Pass 59/59 tests passed across 2 suites (otel.test.js, otel-fanout.test.js)
3. Env Var Forwarding ✅ Pass 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
4. Token Tracker Integration ✅ Pass onUsage callback present in token-tracker-http.js (line 283) as the OTEL hook point
5. OTEL Diagnostics ✅ Pass No endpoint configured → graceful degradation (file fallback at /var/log/api-proxy/otel.jsonl); no errors

All 5 scenarios passed. 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 Result
GitHub MCP Testing ✅ Connected
GitHub.com Connectivity ✅ HTTP 200
File Write/Read Test ✅ Verified
BYOK Inference ✅ Working

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

All systems operational @lpcox

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results

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

Chroot Runtime Version Comparison

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

Result: Not all runtimes match — smoke-chroot label not applied.

Python and Node.js versions differ between the host and the chroot environment. Go matches. This may indicate the chroot image is using an older Ubuntu base (22.04) with older bundled runtimes than the host runner.

Tested by Smoke Chroot

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

Copy link
Copy Markdown
Contributor

Smoke Test Results:

  • fix missing exports/tests symbols: ✅
  • recover PATH after sudo: ✅
  • GitHub.com connectivity: ✅
  • File I/O: ✅
  • Direct BYOK inference: ✅

Running in direct BYOK mode via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)
Overall: PASS

/cc @lpcox

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

@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 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 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 #5685 · 49.4 AIC · ⊞ 7.8K ·

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: GitHub Actions Services Connectivity

Check Result
Redis PING ❌ Timeout (no response on host.docker.internal:6379)
PostgreSQL pg_isready ❌ No response on host.docker.internal:5432
PostgreSQL SELECT 1 ❌ No response (connection failed)

host.docker.internal resolves to 172.17.0.1 but neither service is reachable — ports 6379 and 5432 are not listening on the host.

Overall: FAIL

🔌 Service connectivity validated by Smoke Services

@lpcox lpcox merged commit ad44fe3 into main Jun 29, 2026
90 checks passed
@lpcox lpcox deleted the fix/failing-test-imports branch June 29, 2026 17:03
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