Add route_request dispatch coverage#689
Conversation
prk-Jr
left a comment
There was a problem hiding this comment.
Summary
This PR adds focused Fastly adapter coverage for route_request. The overall direction is useful, but one assertion currently does not prove the route branch it is intended to cover because another branch can produce the same failure status.
CI Status
- cargo fmt: PASS
- cargo test: PASS
- vitest: PASS
- integration tests: PASS
- browser integration tests: PASS
- CodeQL: PASS
- analysis jobs: PASS
aram356
left a comment
There was a problem hiding this comment.
Summary
Decomposing the previous monolithic test into focused per-route dispatch tests is a clean improvement, and the prior blocking concerns from @prk-Jr (auction passing through fallback / ambient DNS dependency) are fully addressed in 3f7d3333 — the "Invalid banner size" body assertion and the .invalid origin URL both make the intended failure modes unambiguous. CI is green and the new tests pass locally.
Requesting changes on one point only: switching auction_route_dispatches_to_auction_handler to consent_store = None proves handler dispatch but drops the regression assertion that runtime_services_for_consent_route actually gates the /auction route. Only the publisher-fallback gate is now under test. A small companion test restores parity with the original coverage — see the inline 🌱.
Non-blocking
🌱 seedling
- Lost regression coverage for "auction returns 503 when consent_store is misconfigured" —
route_tests.rs:296(inline)
♻️ refactor
- Collapse the four-layer settings helper into two —
route_tests.rs:128(inline)
🤔 thinking
.invalid502 is consistent withProxybut not exclusive to it —route_tests.rs:322(inline)
⛏ nitpick
!is_empty()is satisfied by any non-empty body —route_tests.rs:243(inline)
CI Status
- cargo fmt: PASS
- cargo clippy: PASS (verified locally on
trusted-server-adapter-fastly) - cargo test: PASS (verified locally — 7/7 new tests pass)
- vitest: PASS
- format-docs / format-typescript: PASS
- browser integration tests / integration tests: PASS
- CodeQL: PASS
Summary
route_requestdispatch coverage.Closes #451
Tests
cargo test -p trusted-server-adapter-fastly route_tests -- --nocapturecargo fmt --all -- --checkcargo test --workspacecargo clippy --workspace --all-targets --all-features -- -D warnings