fix integration test suites under -Dwarnings and CI DB env - #128
Draft
100-tokens wants to merge 8 commits into
Draft
fix integration test suites under -Dwarnings and CI DB env#128100-tokens wants to merge 8 commits into
100-tokens wants to merge 8 commits into
Conversation
Add DbPool::connect_app with automatic SET ROLE xavyo_app for superuser connections so RLS policies apply when DATABASE_URL points at the xavyo superuser. Split OAuth test pools so service tests keep the regular pool while direct RLS SQL tests use the enforced pool with session-level tenant context. Align OAuth token isolation inserts with current schema (scope, family_id, code_challenge). Fix import helpers and tests for tenant_id on errors, one-active-job-per-tenant constraint, unique token hashes, and empty CSV rejection behavior. Co-authored-by: Pascal Le Clech <100-tokens@users.noreply.github.com>
…tests Prefix unused bindings, add auto_assign_initial_state to lifecycle test initializers, and allow dead_code/unused_imports in shared integration test helpers across connector-entra, governance, siem, and webhooks crates. Co-authored-by: Pascal Le Clech <100-tokens@users.noreply.github.com>
Replace outdated DB-model and service calls with focused tests that match current IdentityMergeService, MicroCertificationService, and CreateMicroCertTrigger APIs so integration builds pass under -Dwarnings. Co-authored-by: Pascal Le Clech <100-tokens@users.noreply.github.com>
detect_device_type returned unknown for all non-mobile UAs, breaking Chrome/Windows and Firefox/macOS parsing. Treat Windows/macOS/Linux/X11 signals as desktop while keeping unrecognized UAs as unknown. Co-authored-by: Pascal Le Clech <100-tokens@users.noreply.github.com>
Seed SQL no longer creates admin@test users; assert the system tenant from bootstrap and RLS readability for a created user instead. Co-authored-by: Pascal Le Clech <100-tokens@users.noreply.github.com>
AuthService::register documents that callers validate first (handlers use PasswordPolicyService). Match that contract in the registration integration test instead of expecting WeakPassword from register(). Co-authored-by: Pascal Le Clech <100-tokens@users.noreply.github.com>
Create real owner users for nhi_identities inserts and send actor_token_type on token-exchange forms so HTTP cases exercise delegation instead of failing invalid_request early. Co-authored-by: Pascal Le Clech <100-tokens@users.noreply.github.com>
The unwrap_or(0.0) check was scanning past load_peer_group_stats into unrelated trend helpers and failing spuriously. Co-authored-by: Pascal Le Clech <100-tokens@users.noreply.github.com>
Comment on lines
+117
to
+118
| "expected a special-character error, got {:?}", | ||
| no_special.errors |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes compile and runtime failures in crate integration suites so they pass with
RUSTFLAGS=-Dwarningsagainst a local/CI Postgres where the app role may share the superuser URL.Changes
-Dwarningsfailures in auth/governance/db/entra/siem/webhooks integration helpers; rewrite stale identity-merge and micro-cert suitesDbPool::connect_app, correct schema/fixtures,DATABASE_URL_SUPERUSERfor setupowner_idusers + requiredactor_token_typeform fieldxavyo-dbsystem-tenant test with bootstrap (no seed admin users)validate_password(handler contract;AuthService::registerdoes not validate)load_peer_group_statsonlyType of Change
Checklist
cargo checkon touched crates)cargo clippy --workspace -- -D warnings)cargo fmt --all --check)tenant_idfilterTesting
Retested with
SQLX_OFFLINE=true,RUSTFLAGS=-Dwarnings, PG on:5432:--features integration--features integration--features integration--features integration--features integration--lib--features integrationNotes
Seed SQL remains empty by design; system tenant comes from bootstrap/migrations. Password policy stays at handler/
validate_passwordlayer perAuthService::registerdocs.