> 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 <siret...@tauware.de>
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: &mut 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] = "<!doctype html><title>🦀</title>".as_bytes();
@@ -455,6 +456,7 @@ mod tests {
         let _app: Router<(), http_body::Limited<Body>> = Router::new().route("/", post(handler));
     }
 
+    #[cfg(feature = "tokio")]
     #[tokio::test]
     async fn body_too_large() {
         const BYTES: &[u8] = "<!doctype html><title>🦀</title>".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)]

Reply via email to