Compare commits

...

4 Commits

Author SHA1 Message Date
Philipp Hofer
1e9fea17e3 fix ci
Some checks failed
CI/CD Pipeline / test (push) Successful in 1m20s
CI/CD Pipeline / deploy (push) Has been cancelled
2025-10-29 12:46:07 +01:00
Philipp Hofer
704708e37f push
Some checks failed
CI/CD Pipeline / test (push) Failing after 46s
CI/CD Pipeline / deploy (push) Has been skipped
2025-10-29 12:17:08 +01:00
b833b2a27a Update tests/integration.rs
All checks were successful
CI/CD Pipeline / test (push) Successful in 1m17s
CI/CD Pipeline / deploy (push) Has been skipped
2025-10-29 12:13:46 +01:00
Philipp Hofer
fb7674eac1 add integration test
All checks were successful
CI/CD Pipeline / test (push) Successful in 1m33s
CI/CD Pipeline / deploy (push) Has been skipped
2025-10-29 12:11:58 +01:00
3 changed files with 37 additions and 3 deletions

View File

@@ -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

View File

@@ -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"] }

34
tests/integration.rs Normal file
View File

@@ -0,0 +1,34 @@
use player::Backend;
#[ignore]
#[tokio::test]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
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(())
}