bugfix: fix axum 0.8 migration in mix-stress testing endpoints (#6824)

This commit is contained in:
Jędrzej Stuczyński
2026-05-26 13:38:29 +01:00
committed by GitHub
parent 9782bae54b
commit 343a48c297
5 changed files with 36 additions and 5 deletions
@@ -61,9 +61,9 @@ pub mod routes {
pub mod results {
use super::*;
pub const TESTRUN_BY_ID: &str = "/testrun/:id";
pub const NYM_NODE_BY_NODE_ID: &str = "/nym-node/:node_id";
pub const NYM_NODE_TESTRUNS: &str = "/nym-node/:node_id/testruns";
pub const TESTRUN_BY_ID: &str = "/testrun/{id}";
pub const NYM_NODE_BY_NODE_ID: &str = "/nym-node/{node_id}";
pub const NYM_NODE_TESTRUNS: &str = "/nym-node/{node_id}/testruns";
pub const TESTRUNS_IN_PROGRESS: &str = "/testruns-in-progress";
pub const TESTRUNS: &str = "/testruns";
pub const NYM_NODES: &str = "/nym-nodes";
@@ -27,3 +27,20 @@ pub(crate) fn routes(
.route_layer(metrics_and_results_auth),
)
}
#[cfg(test)]
mod tests {
use super::*;
use std::sync::Arc;
use zeroize::Zeroizing;
/// Axum 0.8 panics inside `.route(...)` when given the legacy `:param`
/// path syntax. That panic never fires at `cargo check` time, so a regression
/// only surfaces when the orchestrator boots. This test exercises the whole
/// v1 route tree to catch such regressions in CI.
#[test]
fn v1_router_builds_without_panic() {
let dummy_auth = || AuthLayer::new(Arc::new(Zeroizing::new(String::new())));
let _ = routes(dummy_auth(), dummy_auth());
}
}