From 73768e6e3e675b2f761d86d329b83b2d49904a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Pilgaard=20Gr=C3=B8ndahl?= Date: Sun, 6 Oct 2024 19:53:26 +0200 Subject: [PATCH] one more fix sqlserver container --- .../Infrastructure/JordnaerWebApplicationFactory.cs | 5 +++-- .../web/Jordnaer.Tests/Infrastructure/SqlServerContainer.cs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/web/Jordnaer.Tests/Infrastructure/JordnaerWebApplicationFactory.cs b/tests/web/Jordnaer.Tests/Infrastructure/JordnaerWebApplicationFactory.cs index c738e13b..ab13fe71 100644 --- a/tests/web/Jordnaer.Tests/Infrastructure/JordnaerWebApplicationFactory.cs +++ b/tests/web/Jordnaer.Tests/Infrastructure/JordnaerWebApplicationFactory.cs @@ -14,8 +14,9 @@ namespace Jordnaer.Tests.Infrastructure; public class JordnaerWebApplicationFactory : WebApplicationFactory, IAsyncLifetime { private readonly MsSqlContainer _msSqlContainer = new MsSqlBuilder() - .WithName($"SqlServerTestcontainer-{Guid.NewGuid()}") - .Build(); + .WithImage("mcr.microsoft.com/mssql/server:2022-latest") // We set a specific image to circumvent this bug: https://github.com/testcontainers/testcontainers-dotnet/issues/1271 + .WithName($"SqlServerTestcontainer-{Guid.NewGuid()}") + .Build(); private readonly AzuriteContainer _azureBlobStorageContainer = new AzuriteBuilder() .WithName($"AzuriteTestcontainer-{Guid.NewGuid()}") diff --git a/tests/web/Jordnaer.Tests/Infrastructure/SqlServerContainer.cs b/tests/web/Jordnaer.Tests/Infrastructure/SqlServerContainer.cs index 09ce586d..d5f002a8 100644 --- a/tests/web/Jordnaer.Tests/Infrastructure/SqlServerContainer.cs +++ b/tests/web/Jordnaer.Tests/Infrastructure/SqlServerContainer.cs @@ -7,7 +7,7 @@ namespace Jordnaer.Tests.Infrastructure; public class SqlServerContainer : IAsyncLifetime where TDbContext : DbContext { public readonly MsSqlContainer Container = new MsSqlBuilder() - .WithImage("mcr.microsoft.com/mssql/server:2022-latest") + .WithImage("mcr.microsoft.com/mssql/server:2022-latest") // We set a specific image to circumvent this bug: https://github.com/testcontainers/testcontainers-dotnet/issues/1271 .WithName($"SqlServerTestcontainer-{Guid.NewGuid()}") .Build();