Skip to content

Commit

Permalink
[tests] Work around sqlserver 2022-latest latest image breaking with …
Browse files Browse the repository at this point in the history
…testcontainers (#5058)

* [tests] Workaround sqlserver 2022-latest latest image failing

.. with testcontainers because the path `/opt/mssql-tools/bin/sqlcmd`
changed to `/opt/mssql-tools18/bin/sqlcmd`. But this hardcoded path is
being used in testcontainers, causing it to fail.

testcontainers/testcontainers-dotnet#1220
microsoft/mssql-docker#892

* add comment referencing the issue
  • Loading branch information
radical authored Jul 24, 2024
1 parent 975a9fc commit 2749cda
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using Aspire.Components.Common.Tests;
using Aspire.Hosting;
using DotNet.Testcontainers.Builders;
using Testcontainers.MsSql;
using Xunit;

Expand All @@ -21,6 +22,7 @@ public async Task InitializeAsync()
{
Container = new MsSqlBuilder()
.WithImage($"{SqlServerContainerImageTags.Registry}/{SqlServerContainerImageTags.Image}:{SqlServerContainerImageTags.Tag}")
.WithWaitStrategy(Wait.ForUnixContainer().UntilCommandIsCompleted("/opt/mssql-tools18/bin/sqlcmd", "-C", "-Q", "SELECT 1;")) // https://github.com/dotnet/aspire/issues/5057
.Build();
await Container.StartAsync();
}
Expand Down

0 comments on commit 2749cda

Please sign in to comment.