Refactor OIDC provider tests to share base mock server helper#3138
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors OIDC provider tests by centralizing shared mock OIDC server behavior into a helper, reducing duplicated GitHub /token mock setup across Azure, AWS, and GCP test paths.
Changes:
- Adds a shared
createBaseMockServerhelper for common request body collection, GitHub OIDC/tokenhandling, and default 404 behavior. - Updates AWS, GCP, and Azure OIDC provider tests to provide only provider-specific mock routes.
Show a summary per file
| File | Description |
|---|---|
containers/api-proxy/test-helpers/mock-oidc-server.js |
Adds the shared mock OIDC server helper. |
containers/api-proxy/oidc-token-provider.test.js |
Uses the helper for Azure token exchange mock routing. |
containers/api-proxy/gcp-oidc-token-provider.test.js |
Uses the helper for GCP STS and impersonation mock routing. |
containers/api-proxy/aws-oidc-token-provider.test.js |
Uses the helper for AWS STS mock routing. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 0
|
Gemini Engine Smoke Test: FAIL. PR retrieval: ❌. Connectivity: ❌. File/Bash: ✅. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
🔬 Smoke Test Results
Overall: FAIL — GitHub MCP returned 401 and pre-computed step outputs were not substituted into the prompt.
|
Smoke Test: Copilot BYOK (Offline) Mode
Overall: FAIL — pre-step template variables were not substituted; smoke-data outputs are literal strings. The BYOK inference path itself is ✅ working.
|
Smoke Test Results
Result: 2/3 PASSED (1 failed)
|
Smoke Test✅ PRs reviewed: fix: skip node --version check under QEMU emulation in agent Dockerfile; fix: remove unused public exports and normalize test-only access Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Chroot Smoke Test Results
Result: Not all tests passed. Python and Node.js versions differ between host and chroot environments.
|
Smoke Test Results
Overall: FAIL
|
✨ Enhancement
The OIDC provider tests duplicated near-identical mock server setup across AWS, GCP, and Azure paths, including the same GitHub
/tokenhandler. This change consolidates that shared logic into one helper to reduce drift in a security-sensitive auth test path.What does this improve?
createMockServer/createMockOidcServerboilerplate across:containers/api-proxy/aws-oidc-token-provider.test.jscontainers/api-proxy/gcp-oidc-token-provider.test.jscontainers/api-proxy/oidc-token-provider.test.jsWhy is this valuable?
Implementation approach:
containers/api-proxy/test-helpers/mock-oidc-server.jswith:createBaseMockServer(handleProviderRoute, handlers)/tokenGET mock response