From fb7674eac10120d1c7a18d9efbfe9c125b1b157c Mon Sep 17 00:00:00 2001 From: Philipp Hofer Date: Wed, 29 Oct 2025 12:11:58 +0100 Subject: [PATCH 1/4] add integration test --- Cargo.toml | 2 +- tests/integration.rs | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 tests/integration.rs diff --git a/Cargo.toml b/Cargo.toml index fa3e148..4963be0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,4 +10,4 @@ reqwest = { version = "0.12", features = ["stream", "json", "rustls-tls"], defau serde_json = "1" chrono = "0.4" quick-xml = "0.38" -serde = { version = "1.0.228", features = ["derive"] } +serde = { version = "1", features = ["derive"] } diff --git a/tests/integration.rs b/tests/integration.rs new file mode 100644 index 0000000..b82a5c1 --- /dev/null +++ b/tests/integration.rs @@ -0,0 +1,34 @@ +use player::Backend; + +#[ignore] +#[tokio::test] +async fn main() -> Result<(), Box> { + let listener = tokio::net::TcpListener::bind("0.0.0.0:0").await?; + let addr = listener.local_addr().unwrap(); + + // Start server in background task + tokio::spawn(async move { + if let Err(e) = player::start( + "Test Feed".into(), + "http://test.example".into(), + "Test description".into(), + vec!["Test Journal".into()], + listener, + Backend::Prod, + ) + .await + { + eprintln!("Server failed to start: {e}"); + } + }); + + // Allow server startup time + tokio::time::sleep(tokio::time::Duration::from_millis(3000)).await; + + // Verify route responds with success status + let response = reqwest::get(format!("http://{addr}/")).await.unwrap(); + + assert_eq!(response.status(), 200); + + Ok(()) +} From b833b2a27ad0eee89cca92165fcce185f37a3646 Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 29 Oct 2025 12:13:46 +0100 Subject: [PATCH 2/4] Update tests/integration.rs --- tests/integration.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/integration.rs b/tests/integration.rs index b82a5c1..aad33d0 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -1,6 +1,5 @@ use player::Backend; -#[ignore] #[tokio::test] async fn main() -> Result<(), Box> { let listener = tokio::net::TcpListener::bind("0.0.0.0:0").await?; From 704708e37fda6fdb56908faf091c845049885090 Mon Sep 17 00:00:00 2001 From: Philipp Hofer Date: Wed, 29 Oct 2025 12:17:08 +0100 Subject: [PATCH 3/4] push --- .gitea/workflows/action.yml | 4 ++-- tests/integration.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/action.yml b/.gitea/workflows/action.yml index c069909..f7f4795 100644 --- a/.gitea/workflows/action.yml +++ b/.gitea/workflows/action.yml @@ -21,8 +21,8 @@ jobs: - name: Build run: cargo build - - name: Backend tests - run: cargo test --verbose + - name: Tests + run: cargo test --verbose -- --ignored deploy: runs-on: ubuntu-latest diff --git a/tests/integration.rs b/tests/integration.rs index aad33d0..03eb69c 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -1,5 +1,6 @@ use player::Backend; +#[ignored] #[tokio::test] async fn main() -> Result<(), Box> { let listener = tokio::net::TcpListener::bind("0.0.0.0:0").await?; From 1e9fea17e3e1e793c0361bb6e7af80bfb5936a1c Mon Sep 17 00:00:00 2001 From: Philipp Hofer Date: Wed, 29 Oct 2025 12:46:07 +0100 Subject: [PATCH 4/4] fix ci --- tests/integration.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration.rs b/tests/integration.rs index 03eb69c..b82a5c1 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -1,6 +1,6 @@ use player::Backend; -#[ignored] +#[ignore] #[tokio::test] async fn main() -> Result<(), Box> { let listener = tokio::net::TcpListener::bind("0.0.0.0:0").await?;