feat: improve test reliability and add request tracing

- Add retry configuration for flaky tests (2 retries for default, 3 for
OAuth)
- Configure test groups with proper concurrency limits (serial: 1,
integration: 4)
- Add tower-http tracing layer with custom span formatting for HTTP
requests
- Simplify database pool handling by removing unnecessary Arc wrapper
- Improve test context setup with better logging and error handling
- Refactor user creation parameters for better clarity and consistency
- Add debug logging for OAuth cookie handling
This commit is contained in:
Ryan Walters
2025-09-19 17:35:53 -05:00
parent e1b266f3b2
commit 0b5aeceb51
10 changed files with 446 additions and 125 deletions

View File

@@ -1,6 +1,7 @@
[profile.default]
fail-fast = false
slow-timeout = { period = "5s", terminate-after = 6 } # max 30 seconds
slow-timeout = { period = "5s", terminate-after = 3 } # max 15 seconds
retries = 2
# CI machines are pretty slow, so we need to increase the timeout
[profile.ci]
@@ -11,12 +12,18 @@ slow-timeout = { period = "30s", terminate-after = 4 } # max 2 minutes for slow
slow-timeout = { period = "45s", terminate-after = 5 } # max 3.75 minutes for slow tests
status-level = "none"
[[profile.default.overrides]]
# Integration tests in SDL2 run serially (may not be required)
[[profile.default.overrides]]
filter = 'test(pacman::game::)'
test-group = 'serial'
# Integration tests run max 4 at a time
[[profile.default.overrides]]
filter = 'test(pacman-server::tests::oauth)'
test-group = 'integration'
retries = 3
[test-groups]
# Ensure serial tests don't run in parallel
serial = { max-threads = 1 }
integration = { max-threads = 4 }