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

@@ -68,10 +68,10 @@ pub async fn link_oauth_account(
pub async fn create_user(
pool: &sqlx::PgPool,
username: &str,
display_name: Option<&str>,
email: Option<&str>,
avatar_url: Option<&str>,
provider_username: &str,
provider_display_name: Option<&str>,
provider_email: Option<&str>,
provider_avatar_url: Option<&str>,
provider: &str,
provider_user_id: &str,
) -> Result<User, sqlx::Error> {
@@ -82,20 +82,20 @@ pub async fn create_user(
RETURNING id, email, created_at, updated_at
"#,
)
.bind(email)
.bind(provider_email)
.fetch_one(pool)
.await?;
// Create oauth link
let _ = link_oauth_account(
let _linked = link_oauth_account(
pool,
user.id,
provider,
provider_user_id,
email,
Some(username),
display_name,
avatar_url,
provider_email,
Some(provider_username),
provider_display_name,
provider_avatar_url,
)
.await?;