Skip to content

fix: restore unit test coverage for proxy agent paths in config.ts#2799

Merged
brendandburns merged 4 commits intomax-regen-genfrom
copilot/sub-pr-2770-yet-again
Mar 18, 2026
Merged

fix: restore unit test coverage for proxy agent paths in config.ts#2799
brendandburns merged 4 commits intomax-regen-genfrom
copilot/sub-pr-2770-yet-again

Conversation

Copy link
Contributor

Copilot AI commented Mar 17, 2026

The undici migration updated proxy tests to exercise applySecurityAuthenticationcreateDispatcher, leaving the legacy applyToHTTPSOptionscreateAgent path (used for WebSocket connections) untested. Additionally, a test for contextG was referencing a context missing from the proxy kubeconfig fixture, causing a pre-existing test failure.

Changes

  • testdata/kubeconfig-proxy-url.yaml: Added clusterG/contextG/userG (HTTPS server, no proxy) to fix the broken contextG test
  • src/config_test.ts:
    • Re-added imports for SocksProxyAgent, HttpProxyAgent, HttpsProxyAgent
    • Added 5 tests covering applyToHTTPSOptions proxy paths that createDispatcher no longer exercises:
      • SOCKS proxy → SocksProxyAgent
      • HTTPS proxy → HttpsProxyAgent
      • HTTP proxy → HttpProxyAgent
      • Unsupported proxy type → throws
      • HTTP server without skipTLSVerify → throws

Coverage delta: config.ts 97.46% → 99.23% (pre-PR baseline was 99.19%); overall statements 94.83% → 95.12% (baseline 94.97%). Tests: 343 → 348, all passing.


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI mentioned this pull request Mar 17, 2026
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 17, 2026
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 18, 2026
Copilot AI and others added 2 commits March 18, 2026 00:06
Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com>
…test data

Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com>
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Copilot
Once this PR has been reviewed and has the lgtm label, please ask for approval from brendandburns. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 18, 2026
Copilot AI changed the title [WIP] [#2738] Regenerate with new OpenAPI generator fix: restore unit test coverage for proxy agent paths in config.ts Mar 18, 2026
Copilot AI requested a review from brendandburns March 18, 2026 00:12
@brendandburns
Copy link
Contributor

@copilot please revert the changes to the settings file they are unrelated.

Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 18, 2026

@copilot please revert the changes to the settings file they are unrelated.

Done — settings reverted to OPENAPI_GENERATOR_COMMIT=9fa18d0c8102322039676a9d11107a7cd00bf6ae in commit b15d9bd.

@brendandburns brendandburns marked this pull request as ready for review March 18, 2026 20:47
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 18, 2026
@brendandburns brendandburns merged commit 61b081f into max-regen-gen Mar 18, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants