diff --git a/modules/mssql/examples_test.go b/modules/mssql/examples_test.go index f5e7ebd04d..8c1f2c0cac 100644 --- a/modules/mssql/examples_test.go +++ b/modules/mssql/examples_test.go @@ -16,7 +16,7 @@ func ExampleRun() { password := "SuperStrong@Passw0rd" mssqlContainer, err := mssql.Run(ctx, - "mcr.microsoft.com/mssql/server:2022-RTM-GDR1-ubuntu-20.04", + "mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04", mssql.WithAcceptEULA(), mssql.WithPassword(password), ) diff --git a/modules/mssql/mssql.go b/modules/mssql/mssql.go index 57f634c02c..17337bf85b 100644 --- a/modules/mssql/mssql.go +++ b/modules/mssql/mssql.go @@ -44,7 +44,7 @@ func WithPassword(password string) testcontainers.CustomizeRequestOption { // Deprecated: use Run instead // RunContainer creates an instance of the MSSQLServer container type func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*MSSQLServerContainer, error) { - return Run(ctx, "mcr.microsoft.com/mssql/server:2022-CU10-ubuntu-22.04", opts...) + return Run(ctx, "mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04", opts...) } // Run creates an instance of the MSSQLServer container type diff --git a/modules/mssql/mssql_test.go b/modules/mssql/mssql_test.go index 602778f8a0..737c97414e 100644 --- a/modules/mssql/mssql_test.go +++ b/modules/mssql/mssql_test.go @@ -17,7 +17,7 @@ func TestMSSQLServer(t *testing.T) { ctx := context.Background() ctr, err := mssql.Run(ctx, - "mcr.microsoft.com/mssql/server:2022-CU10-ubuntu-22.04", + "mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04", mssql.WithAcceptEULA(), ) testcontainers.CleanupContainer(t, ctr) @@ -46,7 +46,7 @@ func TestMSSQLServerWithMissingEulaOption(t *testing.T) { ctx := context.Background() ctr, err := mssql.Run(ctx, - "mcr.microsoft.com/mssql/server:2022-CU10-ubuntu-22.04", + "mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04", testcontainers.WithWaitStrategy( wait.ForLog("The SQL Server End-User License Agreement (EULA) must be accepted")), ) @@ -65,7 +65,7 @@ func TestMSSQLServerWithConnectionStringParameters(t *testing.T) { ctx := context.Background() ctr, err := mssql.Run(ctx, - "mcr.microsoft.com/mssql/server:2022-CU10-ubuntu-22.04", + "mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04", mssql.WithAcceptEULA(), ) testcontainers.CleanupContainer(t, ctr) @@ -95,7 +95,7 @@ func TestMSSQLServerWithCustomStrongPassword(t *testing.T) { ctx := context.Background() ctr, err := mssql.Run(ctx, - "mcr.microsoft.com/mssql/server:2022-CU10-ubuntu-22.04", + "mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04", mssql.WithAcceptEULA(), mssql.WithPassword("Strong@Passw0rd"), ) @@ -119,7 +119,7 @@ func TestMSSQLServerWithInvalidPassword(t *testing.T) { ctx := context.Background() ctr, err := mssql.Run(ctx, - "mcr.microsoft.com/mssql/server:2022-CU10-ubuntu-22.04", + "mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04", testcontainers.WithWaitStrategy( wait.ForLog("Password validation failed")), mssql.WithAcceptEULA(), @@ -128,25 +128,3 @@ func TestMSSQLServerWithInvalidPassword(t *testing.T) { testcontainers.CleanupContainer(t, ctr) require.NoError(t, err) } - -func TestMSSQLServerWithAlternativeImage(t *testing.T) { - ctx := context.Background() - - ctr, err := mssql.Run(ctx, - "mcr.microsoft.com/mssql/server:2022-RTM-GDR1-ubuntu-20.04", - mssql.WithAcceptEULA(), - ) - testcontainers.CleanupContainer(t, ctr) - require.NoError(t, err) - - // perform assertions - connectionString, err := ctr.ConnectionString(ctx) - require.NoError(t, err) - - db, err := sql.Open("sqlserver", connectionString) - require.NoError(t, err) - defer db.Close() - - err = db.Ping() - require.NoError(t, err) -}