stabilize tests
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Npgsql;
|
||||
using Testcontainers.PostgreSql;
|
||||
using Xunit.Sdk;
|
||||
|
||||
namespace StellaOps.Testing.SchemaEvolution;
|
||||
|
||||
@@ -75,7 +76,16 @@ public abstract class PostgresSchemaEvolutionTestBase : SchemaEvolutionTestBase
|
||||
.WithPassword("test")
|
||||
.Build();
|
||||
|
||||
await container.StartAsync(ct);
|
||||
try
|
||||
{
|
||||
await container.StartAsync(ct);
|
||||
}
|
||||
catch (ArgumentException ex) when (ShouldSkipForMissingDocker(ex))
|
||||
{
|
||||
await container.DisposeAsync();
|
||||
throw SkipException.ForSkip(
|
||||
$"Postgres schema evolution tests require Docker/Testcontainers. Skipping because the container failed to start: {ex.Message}");
|
||||
}
|
||||
|
||||
// Apply migrations up to specified version
|
||||
var connectionString = container.GetConnectionString();
|
||||
@@ -207,4 +217,10 @@ public abstract class PostgresSchemaEvolutionTestBase : SchemaEvolutionTestBase
|
||||
await base.DisposeAsync();
|
||||
_disposed = true;
|
||||
}
|
||||
|
||||
private static bool ShouldSkipForMissingDocker(ArgumentException exception)
|
||||
{
|
||||
return string.Equals(exception.ParamName, "DockerEndpointAuthConfig", StringComparison.Ordinal)
|
||||
|| exception.Message.Contains("Docker is either not running", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# StellaOps.Testing.SchemaEvolution Task Board
|
||||
This board mirrors active sprint tasks for this module.
|
||||
Source of truth: `docs/implplan/SPRINT_20260130_002_Tools_csproj_remediation_solid_review.md`.
|
||||
|
||||
| Task ID | Status | Notes |
|
||||
| --- | --- | --- |
|
||||
| REMED-05 | TODO | Remediation checklist: docs/implplan/audits/csproj-standards/remediation/checklists/src/__Tests/__Libraries/StellaOps.Testing.SchemaEvolution/StellaOps.Testing.SchemaEvolution.md. |
|
||||
| REMED-06 | DONE | SOLID review notes captured for SPRINT_20260130_002. |
|
||||
Reference in New Issue
Block a user