Skip to content

Commit b4e5b57

Browse files
committed
Fix integration tests to match updated server::run signature
Previous: Integration tests were calling spkrd::server::run with three parameters (port, retry_timeout, device_path), following the function signature that existed before debug logging was added to the server module. All four test functions used this outdated calling convention. Changed: Updated all server::run function calls in integration tests to include the fourth debug parameter set to false, maintaining clean test output while matching the current function signature that requires (port, retry_timeout, device_path, debug). See: changelog/20250829-cargo-test-fixes.md
1 parent 6cb544f commit b4e5b57

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Cargo Test Fixes - 2025-08-29
2+
3+
## Task Specification
4+
Fix failing `cargo test` command in the SPKRD project.
5+
6+
## Current Status
7+
COMPLETED - All cargo tests now pass successfully
8+
9+
## Files Modified
10+
- tests/integration_tests.rs (updated all 4 server::run calls to include debug: false parameter)
11+
12+
## High-Level Decisions
13+
- Tests should use `debug: false` since they don't need debug output during testing
14+
15+
## Requirements Changes
16+
(None currently)
17+
18+
## Rationales and Alternatives
19+
- Using `false` for debug parameter in tests keeps test output clean and focused
20+
- Alternative would be `true` but that would add unnecessary verbosity to test runs
21+
22+
## Obstacles and Solutions
23+
- Issue: Function signature mismatch between server::run definition and test calls
24+
- Solution: Add `false` as 4th parameter to all test calls

tests/integration_tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ async fn test_server_with_file_device() {
1313
// Start the server on a random available port
1414
let port = find_available_port().await;
1515
let server_handle = tokio::spawn(async move {
16-
let _ = spkrd::server::run(port, Duration::from_secs(30), device_path).await;
16+
let _ = spkrd::server::run(port, Duration::from_secs(30), device_path, false).await;
1717
});
1818

1919
// Wait a moment for the server to start
@@ -52,7 +52,7 @@ async fn test_melody_validation() {
5252
// Start the server on a random available port
5353
let port = find_available_port().await;
5454
let server_handle = tokio::spawn(async move {
55-
let _ = spkrd::server::run(port, Duration::from_secs(30), device_path).await;
55+
let _ = spkrd::server::run(port, Duration::from_secs(30), device_path, false).await;
5656
});
5757

5858
// Wait a moment for the server to start
@@ -92,7 +92,7 @@ async fn test_multiple_requests() {
9292
// Start the server on a random available port
9393
let port = find_available_port().await;
9494
let server_handle = tokio::spawn(async move {
95-
let _ = spkrd::server::run(port, Duration::from_secs(30), device_path).await;
95+
let _ = spkrd::server::run(port, Duration::from_secs(30), device_path, false).await;
9696
});
9797

9898
// Wait a moment for the server to start
@@ -138,7 +138,7 @@ async fn test_invalid_utf8() {
138138
// Start the server on a random available port
139139
let port = find_available_port().await;
140140
let server_handle = tokio::spawn(async move {
141-
let _ = spkrd::server::run(port, Duration::from_secs(30), device_path).await;
141+
let _ = spkrd::server::run(port, Duration::from_secs(30), device_path, false).await;
142142
});
143143

144144
// Wait a moment for the server to start

0 commit comments

Comments
 (0)