Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mssql): bump Docker image version #2786

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/mssql/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
Expand Down
2 changes: 1 addition & 1 deletion modules/mssql/mssql.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 5 additions & 27 deletions modules/mssql/mssql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")),
)
Expand All @@ -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)
Expand Down Expand Up @@ -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"),
)
Expand All @@ -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(),
Expand All @@ -128,25 +128,3 @@ func TestMSSQLServerWithInvalidPassword(t *testing.T) {
testcontainers.CleanupContainer(t, ctr)
require.NoError(t, err)
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm removing this test because it's doing exactly the same as another one, using an image that at the moment has no alternative. We can remove, or skip, whatever you prefer.

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)
}
Loading