Surfaced by the pre-0.15.0 code review (cleanup, not a bug).
crates/site-e2e/tests/landing_page.rs has some avoidable duplication:
- The version-switcher test re-inlines the
TcpListener::bind / local_addr / tokio::spawn(axum::serve(...)) body that the existing serve() helper already owns, only because it needs to overlay a /versions.json route before the ServeDir fallback. Parameterizing serve() over an optional Router to merge (keeping the ServeDir fallback as the default) would let both call sites share it.
- The dist-exists skip guard and the
Playwright::launch / chromium().launch / new_page / goto setup quartet are repeated across all three tests. A small setup(dist) -> (Page, Browser, JoinHandle) helper would collapse them.
Low urgency — the tests pass and this is purely maintainability. Worth doing when the harness is next touched (e.g. if a launch option or headless toggle needs adding, which would otherwise have to change in every copy).
Surfaced by the pre-0.15.0 code review (cleanup, not a bug).
crates/site-e2e/tests/landing_page.rshas some avoidable duplication:TcpListener::bind/local_addr/tokio::spawn(axum::serve(...))body that the existingserve()helper already owns, only because it needs to overlay a/versions.jsonroute before theServeDirfallback. Parameterizingserve()over an optionalRouterto merge (keeping theServeDirfallback as the default) would let both call sites share it.Playwright::launch/chromium().launch/new_page/gotosetup quartet are repeated across all three tests. A smallsetup(dist) -> (Page, Browser, JoinHandle)helper would collapse them.Low urgency — the tests pass and this is purely maintainability. Worth doing when the harness is next touched (e.g. if a launch option or headless toggle needs adding, which would otherwise have to change in every copy).