Skip to content

fix: gateway-target CLI bugs and enable gateway test coverage#487

Closed
aidandaly24 wants to merge 3 commits intomainfrom
fix/gateway-tests-and-cli-bugs
Closed

fix: gateway-target CLI bugs and enable gateway test coverage#487
aidandaly24 wants to merge 3 commits intomainfrom
fix/gateway-tests-and-cli-bugs

Conversation

@aidandaly24
Copy link
Contributor

@aidandaly24 aidandaly24 commented Mar 3, 2026

Description

Enables comprehensive test coverage for the gateway integration feature. All gateway tests were previously skipped (describe.skip) and several contained pre-alpha assumptions that no longer match the implementation.

Changes:

  • Unskip all 4 gateway test files (add-gateway, add-gateway-target, remove-gateway, remove-gateway-target)
  • Update tests from pre-alpha create-new path to existing-endpoint path (the only user-facing flow)
  • Remove tests for non-existent add bind gateway command and create-new-only validation
  • Add validation tests: rejects create-new source, requires endpoint, invalid OAuth discovery URL
  • Add unit test for auto-create OAuth credential flow in handleAddGatewayTarget
  • Add unit tests for getGatewayEnvVars (previously zero coverage)
  • Add integration test for full gateway lifecycle (add gateway → add target with Exa MCP endpoint → remove target → remove gateway)

Depends on #

Related Issue

Closes #

Documentation PR

N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe): Test coverage for existing gateway feature

Testing

How have you tested the change?

  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

…point

- Pass source/type/endpoint options through command.tsx to handler
  (were silently dropped, breaking --source existing-endpoint)
- Default source to 'existing-endpoint' in validation (only supported path)
- Reject 'create-new' source with clear error message
- Move outbound auth validation before source branching so it applies
  to existing-endpoint targets (was unreachable due to early return)
- Unskip all 4 gateway test files (add/remove gateway/gateway-target)
- Update validGatewayTargetOptions fixture to existing-endpoint
- Remove create-new path tests (not user-facing yet)
- Add tests: rejects create-new source, requires endpoint, invalid
  OAuth discovery URL, auto-create OAuth credential
- Rewrite cascade/removal tests to use --endpoint instead of
  non-existent 'add bind gateway' and --language/--host flags
- Add end-to-end gateway lifecycle test (add gateway, add target with
  Exa MCP endpoint, remove target, remove gateway)
- Add unit tests for getGatewayEnvVars (dev environment setup)
@aidandaly24 aidandaly24 requested a review from a team March 3, 2026 20:05
@github-actions github-actions bot added the size/m PR size: M label Mar 3, 2026
@aidandaly24 aidandaly24 closed this Mar 3, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 46.57% 3429 / 7363
🔵 Statements 46.18% 3610 / 7817
🔵 Functions 48.2% 684 / 1419
🔵 Branches 50.64% 2234 / 4411
Generated in workflow #819 for commit 3b079e9 by the Vitest Coverage Report Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant