Bug#1064232: rust-axum: Failing autopkgtests
Quoting Reinhard Tartler (2024-07-25 08:11:33) > > > rust-axum is unable to migrate to Testing because its autopkgtests are > > failing > > > >> I wonder why you are investing so much time and aggravation into > >> getting the tests to work in Debian? > > > > Rust packages in Debian often deviate from upstream, making it > > particularly relevant for Debian to check as much of upstream test > > coverage as possible. > > This reasoning is sane, but I question whether it actually applies > here. Evidently, upstream does not consider running tests in the > individual crates of the workspace and isn't even accepting patches to > correct rather obvious oversights here. I find it admiring that you > decide to step up, and invest significant portions of your available > time to do the additional work nevertheless. Upstream targets a distribution (the distributed set of components at crates.io) where each version of dependencies and reverse dependencies are static. That's not the case for the Debian distribution. > Please find a patch attached that should fix the remaining autopkgtest > failures. Thanks! I had not even noticed that those were missing - I were fighting the failure to compile autopkgtests due to a missing file. > I do have to wonder though: src:rust-axum is already at the thirty-first > revision. Are the autopkgtests passing on your computer? I wonder what > can be done avoid needing that many uploads, causing avoidable load on > the test machines and help unblocking other packages from their > migration to testing faster. Building is quite heavy for my local system, so often rely on the build daemons for testing. - Jonas -- * Jonas Smedegaard - idealist & Internet-arkitekt * Tlf.: +45 40843136 Website: http://dr.jones.dk/ * Sponsorship: https://ko-fi.com/drjones [x] quote me freely [ ] ask before reusing [ ] keep private signature.asc Description: signature
Bug#1064232: rust-axum: Failing autopkgtests
> rust-axum is unable to migrate to Testing because its autopkgtests are > failing >> I wonder why you are investing so much time and aggravation into >> getting the tests to work in Debian? > > Rust packages in Debian often deviate from upstream, making it > particularly relevant for Debian to check as much of upstream test > coverage as possible. This reasoning is sane, but I question whether it actually applies here. Evidently, upstream does not consider running tests in the individual crates of the workspace and isn't even accepting patches to correct rather obvious oversights here. I find it admiring that you decide to step up, and invest significant portions of your available time to do the additional work nevertheless. Please find a patch attached that should fix the remaining autopkgtest failures. I do have to wonder though: src:rust-axum is already at the thirty-first revision. Are the autopkgtests passing on your computer? I wonder what can be done avoid needing that many uploads, causing avoidable load on the test machines and help unblocking other packages from their migration to testing faster. best, -rt From: Reinhard Tartler Date: Thu, 25 Jul 2024 07:59:05 +0200 Subject: axum-extra: Add missing feature dependencies to tests --- axum-extra/src/extract/cookie/mod.rs | 1 + axum-extra/src/extract/multipart.rs | 2 ++ axum-extra/src/json_lines.rs | 2 ++ axum-extra/src/protobuf.rs | 3 +++ 4 files changed, 8 insertions(+) diff --git a/axum-extra/src/extract/cookie/mod.rs b/axum-extra/src/extract/cookie/mod.rs index 175bf9e..0315c41 100644 --- a/axum-extra/src/extract/cookie/mod.rs +++ b/axum-extra/src/extract/cookie/mod.rs @@ -228,6 +228,7 @@ fn set_cookies(jar: cookie::CookieJar, headers: HeaderMap) { // jar so it cannot be called multiple times. } +#[cfg(any(feature = "cookie-signed", feature = "cookie-private"))] #[cfg(test)] mod tests { use super::*; diff --git a/axum-extra/src/extract/multipart.rs b/axum-extra/src/extract/multipart.rs index 5ce7307..ba5256b 100644 --- a/axum-extra/src/extract/multipart.rs +++ b/axum-extra/src/extract/multipart.rs @@ -418,6 +418,7 @@ mod tests { body::Body, extract::DefaultBodyLimit, response::IntoResponse, routing::post, Router, }; +#[cfg(feature = "tokio")] #[tokio::test] async fn content_type_with_encoding() { const BYTES: &[u8] = "呂".as_bytes(); @@ -455,6 +456,7 @@ mod tests { let _app: Router<(), http_body::Limited> = Router::new().route("/", post(handler)); } +#[cfg(feature = "tokio")] #[tokio::test] async fn body_too_large() { const BYTES: &[u8] = "呂".as_bytes(); diff --git a/axum-extra/src/json_lines.rs b/axum-extra/src/json_lines.rs index 215f424..9a78001 100644 --- a/axum-extra/src/json_lines.rs +++ b/axum-extra/src/json_lines.rs @@ -219,6 +219,7 @@ mod tests { id: i32, } +#[cfg(feature = "tokio")] #[tokio::test] async fn extractor() { let app = Router::new().route( @@ -257,6 +258,7 @@ mod tests { assert_eq!(res.status(), StatusCode::OK); } +#[cfg(feature = "tokio")] #[tokio::test] async fn response() { let app = Router::new().route( diff --git a/axum-extra/src/protobuf.rs b/axum-extra/src/protobuf.rs index 1750c52..401cb22 100644 --- a/axum-extra/src/protobuf.rs +++ b/axum-extra/src/protobuf.rs @@ -212,6 +212,7 @@ mod tests { use axum::{routing::post, Router}; use http::StatusCode; +#[cfg(feature = "tokio")] #[tokio::test] async fn decode_body() { #[derive(prost::Message)] @@ -237,6 +238,7 @@ mod tests { assert_eq!(body, "bar"); } +#[cfg(feature = "tokio")] #[tokio::test] async fn prost_decode_error() { #[derive(prost::Message)] @@ -263,6 +265,7 @@ mod tests { assert_eq!(res.status(), StatusCode::UNPROCESSABLE_ENTITY); } +#[cfg(feature = "tokio")] #[tokio::test] async fn encode_body() { #[derive(prost::Message)]
Bug#1064232: rust-axum: Failing autopkgtests
Hi Jonas, > I'm currently traveling and cannot focus on this issue as much as I > would like to at the moment. I also don't see any issue in the actual > upstream code; rather the issue is with the tests. As such, I honestly > beleive that for the time being, disabling those tests doesn't loose > us coverage, but to the contrary, is an impediment of finding other, > real issues in the code by using it from application code that > actually needs it in the wild. Please find an upstream patch attached to this email. In that patch I was sprinkling conditional compilation constraint throughout the codebase that allows `cargo test --no-default features`, as well as `--no-default-fetaures --features $F` for $F in all features indivually to pass. Thank you for your timely reponses! From: Reinhard Tartler Date: Sat, 20 Jul 2024 07:05:45 +0200 Subject: Unbreak 'cargo test --no-default-features' Add appropriate feature constraints throughout the code --- axum/src/extract/host.rs | 1 + axum/src/extract/matched_path.rs | 1 + axum/src/extract/mod.rs| 1 + axum/src/extract/multipart.rs | 1 + axum/src/extract/path/mod.rs | 1 + axum/src/extract/query.rs | 1 + axum/src/extract/request_parts.rs | 1 + axum/src/form.rs | 1 + axum/src/handler/mod.rs| 1 + axum/src/middleware/from_extractor.rs | 1 + axum/src/middleware/map_request.rs | 1 + axum/src/middleware/map_response.rs| 1 + axum/src/response/sse.rs | 1 + axum/src/routing/method_routing.rs | 1 + axum/src/routing/tests/fallback.rs | 21 +++ axum/src/routing/tests/handle_error.rs | 4 +++ axum/src/routing/tests/merge.rs| 24 - axum/src/routing/tests/mod.rs | 48 +- axum/src/routing/tests/nest.rs | 17 axum/src/test_helpers/test_client.rs | 6 + axum/src/typed_header.rs | 1 + 21 files changed, 133 insertions(+), 2 deletions(-) diff --git a/axum/src/extract/host.rs b/axum/src/extract/host.rs index d5be6a9..a3e374d 100644 --- a/axum/src/extract/host.rs +++ b/axum/src/extract/host.rs @@ -76,6 +76,7 @@ fn parse_forwarded(headers: ) -> Option<> { }) } +#[cfg(feature = "tokio")] #[cfg(test)] mod tests { use super::*; diff --git a/axum/src/extract/matched_path.rs b/axum/src/extract/matched_path.rs index c3bd7b4..760748c 100644 --- a/axum/src/extract/matched_path.rs +++ b/axum/src/extract/matched_path.rs @@ -168,6 +168,7 @@ fn append_nested_matched_path(matched_path: , extensions: ::Extens } } +#[cfg(feature = "tokio")] #[cfg(test)] mod tests { use super::*; diff --git a/axum/src/extract/mod.rs b/axum/src/extract/mod.rs index cb4ebcd..4d327a8 100644 --- a/axum/src/extract/mod.rs +++ b/axum/src/extract/mod.rs @@ -98,6 +98,7 @@ pub(super) fn has_content_type(headers: , expected_content_type: content_type.starts_with(expected_content_type.as_ref()) } +#[cfg(feature = "tokio")] #[cfg(test)] mod tests { use crate::{routing::get, test_helpers::*, Router}; diff --git a/axum/src/extract/multipart.rs b/axum/src/extract/multipart.rs index 3827734..3ef05f8 100644 --- a/axum/src/extract/multipart.rs +++ b/axum/src/extract/multipart.rs @@ -305,6 +305,7 @@ define_rejection! { pub struct InvalidBoundary; } +#[cfg(feature = "tokio")] #[cfg(test)] mod tests { use axum_core::extract::DefaultBodyLimit; diff --git a/axum/src/extract/path/mod.rs b/axum/src/extract/path/mod.rs index 189e476..16e16e5 100644 --- a/axum/src/extract/path/mod.rs +++ b/axum/src/extract/path/mod.rs @@ -539,6 +539,7 @@ impl IntoResponse for InvalidUtf8InPathParam { } } +#[cfg(feature = "tokio")] #[cfg(test)] mod tests { use super::*; diff --git a/axum/src/extract/query.rs b/axum/src/extract/query.rs index 6f8cb89..76c140b 100644 --- a/axum/src/extract/query.rs +++ b/axum/src/extract/query.rs @@ -94,6 +94,7 @@ where axum_core::__impl_deref!(Query); +#[cfg(feature = "tokio")] #[cfg(test)] mod tests { use crate::{routing::get, test_helpers::TestClient, Router}; diff --git a/axum/src/extract/request_parts.rs b/axum/src/extract/request_parts.rs index 9af618f..2536b69 100644 --- a/axum/src/extract/request_parts.rs +++ b/axum/src/extract/request_parts.rs @@ -226,6 +226,7 @@ where axum_core::__impl_deref!(RawBody); +#[cfg(feature = "tokio")] #[cfg(test)] mod tests { use crate::{extract::Extension, routing::get, test_helpers::*, Router}; diff --git a/axum/src/form.rs b/axum/src/form.rs index c690d48..906a873 100644 --- a/axum/src/form.rs +++ b/axum/src/form.rs @@ -116,6 +116,7 @@ where axum_core::__impl_deref!(Form); +#[cfg(feature = "tokio")] #[cfg(test)] mod tests { use super::*; diff --git a/axum/src/handler/mod.rs b/axum/src/handler/mod.rs index 5087ac7..fdf569e 100644 --- a/axum/src/handler/mod.rs +++ b/axum/src/handler/mod.rs @@
Bug#1064232: rust-axum: Failing autopkgtests
Control: reopen -1 > Oh - now after I did a release without the feature-fencing patch, I > found the relevant build log: > https://ci.debian.net/data/autopkgtest/testing/amd64/r/rust-axum/47457177/log.gz the most recent run at https://ci.debian.net/packages/r/rust-axum/testing/amd64/49206913/ failed in a similar way: 1738s autopkgtest [21:38:01]: test rust-axum-macros-0.3:default: ---] 1738s autopkgtest [21:38:01]: test rust-axum-macros-0.3:default: - - - - - - - - - - results - - - - - - - - - - 1738s rust-axum-macros-0.3:default PASS 1738s autopkgtest [21:38:01]: summary 1738s rust-axum-0.6:@ PASS 1738s rust-axum-0.6: FAIL non-zero exit status 101 1738s rust-axum-0.6:default PASS 1738s rust-axum-0.6:form FAIL non-zero exit status 101 1738s rust-axum-0.6:headers FAIL non-zero exit status 101 1738s rust-axum-0.6:http1 FAIL non-zero exit status 101 1738s rust-axum-0.6:http2 FAIL non-zero exit status 101 1738s rust-axum-0.6:json PASS 1738s rust-axum-0.6:macros FAIL non-zero exit status 101 1738s rust-axum-0.6:matched-path FAIL non-zero exit status 101 1738s rust-axum-0.6:multipart FAIL non-zero exit status 101 1738s rust-axum-0.6:original-uri FAIL non-zero exit status 101 1738s rust-axum-0.6:query FAIL non-zero exit status 101 1738s rust-axum-0.6:tokio FAIL non-zero exit status 101 1738s rust-axum-0.6:tower-log FAIL non-zero exit status 101 1738s rust-axum-0.6:tracing FAIL non-zero exit status 101 1738s rust-axum-0.6:ws FAIL non-zero exit status 101 1738s rust-axum-core-0.3:@ PASS 1738s rust-axum-core-0.3: PASS 1738s rust-axum-core-0.3:default PASS 1738s rust-axum-core-0.3:tracing PASS 1738s rust-axum-macros-0.3:@ PASS 1738s rust-axum-macros-0.3: PASS 1738s rust-axum-macros-0.3:default PASS After looking a bit more into axum, and after reading the conversation upstream, it seems to me that there is little appetite upstream for having the individual crates self-testable. In fact, this cannot work in the current form as some features, most notably the json feature, is not optional at all but in fact mandatory for the tests. That means that you would need to mark a whole lot of tests as dependent on the presence of indivudal features. That can be done by adding apppropriate feature annotations in the rust-axum test code, but given rust-axum is currently holding up migration of other packages (such as rust-tonic and aardvark-dns), I would like to repeat my recommendation to disable those autopkgtests that trigger "--no-default-features". I'm currently traveling and cannot focus on this issue as much as I would like to at the moment. I also don't see any issue in the actual upstream code; rather the issue is with the tests. As such, I honestly beleive that for the time being, disabling those tests doesn't loose us coverage, but to the contrary, is an impediment of finding other, real issues in the code by using it from application code that actually needs it in the wild.
Bug#1064232: rust-axum: Failing autopkgtests
Control: reopen -1 I'm reopening this bug since the autopkgtests are still failing. https://qa.debian.org/excuses.php?package=rust-axum Thank you, Jeremy Bícha
Bug#1064232: rust-axum: Failing autopkgtests
Source: rust-axum Version: 0.6.20-16 Severity: serious rust-axum is unable to migrate to Testing because its autopkgtests are failing https://qa.debian.org/excuses.php?package=rust-axum Thank you, Jeremy Bícha