fix: share one PostgreSQL Testcontainer across all test projects

Create Heimdall.TestCommon project with a single PostgreSqlContainerFixture
shared by both Infrastructure and Integration tests. This prevents Docker
resource conflicts from starting two PostgreSQL containers and ensures
both test suites connect to the same database instance.

- Move shared fixture to tests/Heimdall.TestCommon
- Remove duplicate fixtures from each test project
- Keep test isolation (truncation) and FK fix from previous commit
- Revert DATABASE_URL env var check (Testcontainers works in CI)
This commit is contained in:
Arnaud Dartois committed 2026-07-21 18:48:39 +00:00
1 parent 53e0d4c199
commit b167c2afcf
12 files changed
+83 -122

No files matched your search

@@ -0,0 +1,12 @@
using Heimdall.TestCommon;
namespace Heimdall.IntegrationTests.Controllers;
/// <summary>
/// Collection definition for Integration tests that need PostgreSQL.
/// Uses the shared <see cref="PostgreSqlContainerFixture"/> from Heimdall.TestCommon.
/// </summary>
[CollectionDefinition("Postgres")]
public sealed class PostgresDefinition : ICollectionFixture<PostgreSqlContainerFixture>
{
}