Skip to content

Commit

Permalink
simplify MSSQL images
Browse files Browse the repository at this point in the history
remove MSSQL_2022_UBUNTU_2024. Rename into MSSQL_VERSION, get everything on latest
  • Loading branch information
stephane-airbyte committed Dec 7, 2023
1 parent d990f5d commit 32a580f
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected JsonNode getConfig() {

@Override
protected void setupEnvironment(final TestDestinationEnv environment) throws Exception {
testdb = MsSQLTestDatabase.in(BaseImage.MSSQL_2017_LATEST, ContainerModifier.NETWORK);
testdb = MsSQLTestDatabase.in(BaseImage.MSSQL_2017, ContainerModifier.NETWORK);
testdb = testdb
.with("ALTER DATABASE %s SET AUTO_CLOSE OFF WITH NO_WAIT;", testdb.getDatabaseName())
.with("CREATE TABLE id_and_name(id INTEGER, name VARCHAR(200), born DATETIMEOFFSET(7));")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected JsonNode getState() {

@Override
protected void setupEnvironment(final TestDestinationEnv environment) {
testdb = MsSQLTestDatabase.in(BaseImage.MSSQL_2022_LATEST, ContainerModifier.AGENT);
testdb = MsSQLTestDatabase.in(BaseImage.MSSQL_2022, ContainerModifier.AGENT);
final var enableCdcSqlFmt = """
EXEC sys.sp_cdc_enable_table
\t@source_schema = N'%s',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected JsonNode getConfig() {

@Override
protected Database setupDatabase() {
testdb = MsSQLTestDatabase.in(BaseImage.MSSQL_2022_LATEST, ContainerModifier.AGENT)
testdb = MsSQLTestDatabase.in(BaseImage.MSSQL_2022, ContainerModifier.AGENT)
.withSnapshotIsolation()
.withCdc();
return testdb.getDatabase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class MssqlSourceAcceptanceTest extends SourceAcceptanceTest {

@Override
protected void setupEnvironment(final TestDestinationEnv environment) throws SQLException {
testdb = MsSQLTestDatabase.in(BaseImage.MSSQL_2022_UBUNTU_20_04)
testdb = MsSQLTestDatabase.in(BaseImage.MSSQL_2022)
.with("CREATE TABLE id_and_name(id INTEGER, name VARCHAR(200), born DATETIMEOFFSET(7));")
.with("INSERT INTO id_and_name (id, name, born) VALUES " +
"(1, 'picard', '2124-03-04T01:01:01Z'), " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class MssqlSourceDatatypeTest extends AbstractMssqlSourceDatatypeTest {

@Override
protected Database setupDatabase() {
testdb = MsSQLTestDatabase.in(BaseImage.MSSQL_2022_UBUNTU_20_04);
testdb = MsSQLTestDatabase.in(BaseImage.MSSQL_2022);
return testdb.getDatabase();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected MssqlSource source() {

@Override
protected MsSQLTestDatabase createTestDatabase() {
return MsSQLTestDatabase.in(BaseImage.MSSQL_2022_LATEST);
return MsSQLTestDatabase.in(BaseImage.MSSQL_2022);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class MssqlSourceTest {
// 2. /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "A_Str0ng_Required_Password"
@BeforeEach
void setup() {
testdb = MsSQLTestDatabase.in(BaseImage.MSSQL_2022_LATEST)
testdb = MsSQLTestDatabase.in(BaseImage.MSSQL_2022)
.with("CREATE TABLE id_and_name(id INTEGER NOT NULL, name VARCHAR(200), born DATETIMEOFFSET(7));")
.with("INSERT INTO id_and_name (id, name, born) VALUES (1,'picard', '2124-03-04T01:01:01Z'), (2, 'crusher', " +
"'2124-03-04T01:01:01Z'), (3, 'vash', '2124-03-04T01:01:01Z');");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ public class MsSQLTestDatabase extends TestDatabase<MSSQLServerContainer<?>, MsS

public static enum BaseImage {

MSSQL_2022_UBUNTU_20_04("mcr.microsoft.com/mssql/server:2022-RTM-CU2-ubuntu-20.04"),
MSSQL_2022_LATEST("mcr.microsoft.com/mssql/server:2022-latest"),
MSSQL_2017_LATEST("mcr.microsoft.com/mssql/server:2017-latest"),
MSSQL_2022("mcr.microsoft.com/mssql/server:2022-latest"),
MSSQL_2017("mcr.microsoft.com/mssql/server:2017-latest"),
;

private final String reference;
Expand Down

0 comments on commit 32a580f

Please sign in to comment.