Enhance test infrastructure and configuration for JWKS and Docker setup
ci/woodpecker/push/build-arm Pipeline was successful

- Updated Azaion.Missions.csproj to exclude test sources from service compilation, preventing build failures due to test project dependencies.
- Modified docker-compose.test.yml to preload the pg_stat_statements extension for testing and adjusted JWT refresh intervals for better test execution timing.
- Enhanced Dockerfile to install wget for health checks and ensure proper initialization of the container.
- Introduced a test-only endpoint for JWKS refresh to facilitate end-to-end testing without relying on the default refresh intervals.
- Updated DTOs in ApiDtos.cs to reflect camelCase naming conventions for consistency with service responses.
- Improved test cases to handle JWKS rotation and refresh scenarios effectively, ensuring robust validation of JWT handling.

This commit lays the groundwork for more reliable and efficient testing of the Azaion.Missions project.
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-05-16 10:20:38 +03:00
parent 001e80fe96
commit 3398ec49a0
29 changed files with 785 additions and 111 deletions
@@ -49,6 +49,7 @@ public sealed class DefaultVehicleRaceTests : TestBase, IClassFixture<DbResetFix
var observations = new int[Iterations];
// Act
for (int i = 0; i < Iterations; i++)
{
ResetVehiclesAndSeedOneDefault();
@@ -101,10 +102,11 @@ public sealed class DefaultVehicleRaceTests : TestBase, IClassFixture<DbResetFix
await conn.OpenAsync();
await using var cmd = conn.CreateCommand();
cmd.CommandText = """
INSERT INTO vehicles (id, name, is_default, created_at, updated_at)
VALUES (@id, @name, TRUE, NOW(), NOW());
INSERT INTO vehicles (id, model, name, is_default)
VALUES (@id, @model, @name, TRUE);
""";
cmd.Parameters.AddWithValue("id", vehicleId);
cmd.Parameters.AddWithValue("model", "race-model");
cmd.Parameters.AddWithValue("name", $"race-side-{vehicleId:N}");
await cmd.ExecuteNonQueryAsync();
return new SideChannelState(true, null);
@@ -122,8 +124,8 @@ public sealed class DefaultVehicleRaceTests : TestBase, IClassFixture<DbResetFix
using var cmd = conn.CreateCommand();
cmd.CommandText = """
TRUNCATE vehicles RESTART IDENTITY CASCADE;
INSERT INTO vehicles (id, name, is_default, created_at, updated_at)
VALUES (gen_random_uuid(), 'seed-default', TRUE, NOW(), NOW());
INSERT INTO vehicles (id, model, name, is_default)
VALUES (gen_random_uuid(), 'seed-model', 'seed-default', TRUE);
""";
cmd.ExecuteNonQuery();
}