Integration testing (Endatix API)
Tests exercise Endatix.WebHost with Testcontainers, Respawn, and WebApplicationFactory. Paths are relative to the Endatix repository root.
Prerequisites
- Docker
- .NET SDK from
global.json
Quick start
dotnet test tests/Endatix.IntegrationTests/Endatix.IntegrationTests.csproj -c Release
This runs the PostgreSQL suite (project default filter). For SQL Server:
ENDATIX_TEST_DB_PROVIDER=SqlServer \
dotnet test tests/Endatix.IntegrationTests/Endatix.IntegrationTests.csproj -c Release \
--filter "Category!=Keycloak&DbSpecific!=PostgreSql"
Full details: tests/README.md.
Configuration
| Variable | Purpose |
|---|---|
ENDATIX_TEST_DB_PROVIDER | PostgreSql (default) or SqlServer |
ENDATIX_TEST_HOST_MODE | ProductionProgram (default) or DedicatedIntegrationHost |
ENDATIX_TEST_REUSE_CONTAINERS | true to reuse containers locally (dev only) |
Test world
IntegrationTestWorld world = await _fixture.PrepareWorldAsync(
IntegrationWorldOptions.SingleTenant with { DefaultPassword = "Password123!" });
HttpClient admin = await world.AsAsync(TestPersona.TenantAdmin);
See AuthLoginFlowTests and tests/Endatix.IntegrationTests/AGENTS.md for contributor guidance.
CI
.github/workflows/build-ci.yml runs a provider matrix: PostgreSQL job (IntegrationTestFilters.Default) and SQL Server job (IntegrationTestFilters.SqlServer). PRs use the faster PrFast filter on PostgreSQL.