Skip to content

test(dgw): drop the devolutions-gateway dev-dependency - #2101

Open
Benoît Cortier (CBenoit) wants to merge 2 commits into
masterfrom
cbenoit-drop-gateway-dev-dependency
Open

Benoît Cortier (CBenoit) wants to merge 2 commits into
masterfrom
cbenoit-drop-gateway-dev-dependency

Conversation

@CBenoit

Copy link
Copy Markdown
Member

Linking the Gateway library pulled axum, hyper, rustls, and the rest of the Gateway into the test binary, and let tests rebuild Gateway internals in-process instead of driving the shipped binary.

The agent-routed KDC, forwarding, and JMUX tests now start the Gateway binary and use a stand-in Agent (cli/dgw/fake_agent.rs) that enrolls through /jet/tunnel/enroll and speaks the agent tunnel protocol over QUIC with the agent-tunnel-proto crate.
Token claims are plain JSON.
No Gateway source change or __debug__ knob was needed.
nonempty was only used with Gateway types and is removed too.

Former test Decision Reason
cli::agent::tunnel (claim building) Rewritten Claims are JSON values signed as before; the Gateway types were only serializers.
kdc::kdc_connector_relays_tcp_through_a_matching_agent Rewritten as cli::dgw::kdc_proxy::kdc_proxy_relays_tcp_through_a_matching_agent Reachable through /jet/KdcProxy; the stand-in Agent checks the session ID (token jti), the target, and the relayed bytes.
kdc::kdc_connector_falls_back_to_direct_tcp_without_a_matching_route Rewritten as kdc_proxy_falls_back_to_direct_tcp_without_a_matching_route Reachable through /jet/KdcProxy.
kdc::kdc_connector_rejects_udp_selected_for_an_agent_route Rewritten as kdc_proxy_rejects_udp_selected_for_an_agent_route Reachable; now also asserts that no datagram reaches the KDC directly.
kdc::kdc_connector_rejects_udp_for_an_explicit_agent_before_dialing Rewritten as kdc_proxy_rejects_udp_for_an_explicit_agent_before_dialing Reachable; now also asserts that no datagram reaches the KDC directly.
kdc::kdc_connector_rejects_an_explicit_missing_agent Deleted Duplicates kdc_proxy_never_dials_the_kdc_directly_for_a_missing_explicit_agent, which also checks that the KDC is never dialed.
integration::gateway_connect_upstream_routes_wildcard_domain_without_subnets Rewritten as cli::dgw::fwd_tcp::fwd_routes_wildcard_domain_without_subnets Reachable through /jet/fwd/tcp.
integration::gateway_connect_upstream_falls_back_to_direct_tcp_without_a_route Rewritten as fwd_falls_back_to_direct_tcp_without_a_route Reachable through /jet/fwd/tcp.
integration::gateway_connect_upstream_uses_explicit_agent_without_a_matching_route Rewritten as fwd_uses_explicit_agent_without_a_matching_route Reachable; now also asserts that the target is not dialed directly.
integration::gateway_connect_upstream_tries_the_next_matching_agent Rewritten as fwd_tries_the_next_matching_agent Reachable; whichever agent is asked first refuses, so the test does not depend on route ordering, which the registry tests cover.
integration::gateway_connect_upstream_does_not_bypass_failed_agent_routes Rewritten as fwd_does_not_bypass_failed_agent_routes Reachable; checks that both agents are asked, the session closes, and the target is not dialed directly.
integration::gateway_jmux_* (4 tests) Rewritten as cli::dgw::jmux::jmux_* Reachable through /jet/jmux with JMUX frames over WebSocket. The disabled-tunnel case asserts close code 1011.
integration::gateway_listener_* (4 tests) Kept, file renamed to agent_tunnel/listener.rs They exercise only the agent-tunnel library.

Fixes #2090

Copilot AI balanced review requested due to automatic review settings October 16, 2026 03:59
@CBenoit

Copy link
Copy Markdown
Member Author

Validation on Windows:

  • Before (origin/master c16eb58): cargo test -p testsuite passed 166, failed 0, ignored 5.
  • After: cargo test -p testsuite passed 165, failed 0, ignored 5. The one fewer test is the deleted duplicate kdc_connector_rejects_an_explicit_missing_agent.
  • Affected tests: all 14 converted tests, the existing kdc_proxy test, the 4 listener tests, and enrolled_agent_forwards_domain_only_route_and_reconnects pass. docker_isolates_real_agent_dns_and_ip_routes stays ignored because it needs Docker; it compiles with the JSON claims but was not run.
  • cargo +nightly fmt --all -- --check, cargo clippy --workspace --tests, and cargo test --workspace are clean.

fwd_does_not_bypass_failed_agent_routes checks only that the session closes, not code 1014: tungstenite treats 1014 as reserved and reports it to the client as 1002.

Note

LLM-assisted content (no human feedback).

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.

🔵 Needs a closer look

The cross-process QUIC and WebSocket test migration needs runtime validation and final human review.

1 open finding
What changed in this PR

Removes the testsuite’s Gateway library dependency by moving routing tests to the shipped binary, addressing #2090.

Changes:

  • Tests KDC, forwarding, and JMUX through public endpoints with a fake Agent.
  • Builds token claims as JSON and preserves listener-library tests.
  • Removes unused dependencies and internal test helpers.
File Description
testsuite/​tests/​cli/​dgw/​mod.rs Registers new test modules.
testsuite/​tests/​cli/​dgw/​kdc_proxy.rs Adds binary-driven KDC routing tests.
testsuite/​tests/​cli/​dgw/​jmux.rs Tests JMUX routing over WebSocket.
testsuite/​tests/​cli/​dgw/​fwd_tcp.rs Tests forwarding and fallback behavior.
testsuite/​tests/​cli/​dgw/​fake_agent.rs Adds enrollment and QUIC test support.
testsuite/​tests/​cli/​agent/​tunnel.rs Replaces Gateway claim types with JSON.
testsuite/​tests/​agent_tunnel/​mod.rs Updates module visibility and organization.
testsuite/​tests/​agent_tunnel/​listener.rs Preserves four listener-library tests.
testsuite/​tests/​agent_tunnel/​kdc.rs Removes replaced internal KDC tests.
testsuite/​tests/​agent_tunnel/​integration.rs Removes migrated integration tests.
testsuite/​tests/​agent_tunnel/​common.rs Exposes shared helpers and removes unused ones.
testsuite/​Cargo.toml Removes Gateway and nonempty dependencies.
Cargo.lock Updates testsuite dependency entries.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread testsuite/tests/cli/dgw/kdc_proxy.rs Resolved

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.

🟢 Approval recommended

The migration preserves routing and no-fallback coverage, resolves the prior response-body concern, and leaves production behavior unchanged.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Linking the Gateway library pulled axum, hyper, rustls, and the rest of
the Gateway into the test binary, and let tests rebuild Gateway
internals in-process instead of driving the shipped binary.

The agent-routed KDC, forwarding, and JMUX tests now start the Gateway
binary and use a stand-in Agent that enrolls over HTTP and speaks the
agent tunnel protocol over QUIC. Token claims are plain JSON. No
Gateway source change was needed.

Fixes #2090

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@CBenoit
Benoît Cortier (CBenoit) force-pushed the cbenoit-drop-gateway-dev-dependency branch from d487ed9 to 8b1448b Compare October 21, 2026 20:36

This branch has not been deployed

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

test(testsuite): drop the devolutions-gateway dev-dependency

2 participants