Skip to content

Commit

Permalink
simplify postgres base images
Browse files Browse the repository at this point in the history
remove mentions of the debian release (alpine, bullseye), using latest instead.
  • Loading branch information
stephane-airbyte committed Dec 8, 2023
1 parent dccd48a commit be6585d
Show file tree
Hide file tree
Showing 23 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected FeatureFlags featureFlags() {

@Override
protected void setupEnvironment(final TestDestinationEnv environment) throws Exception {
testdb = PostgresTestDatabase.in(BaseImage.POSTGRES_16_BULLSEYE, ContainerModifier.CERT)
testdb = PostgresTestDatabase.in(BaseImage.POSTGRES_16, ContainerModifier.CERT)
.with("CREATE TABLE id_and_name(id INTEGER, name VARCHAR(200));")
.with("INSERT INTO id_and_name (id, name) VALUES (1,'picard'), (2, 'crusher'), (3, 'vash');")
.with("CREATE TABLE starships(id INTEGER, name VARCHAR(200));")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected FeatureFlags featureFlags() {
// requiring data to already be in place.
@Override
protected void setupEnvironment(final TestDestinationEnv environment) throws Exception {
testdb = PostgresTestDatabase.in(BaseImage.POSTGRES_16_BULLSEYE, ContainerModifier.NETWORK);
testdb = PostgresTestDatabase.in(BaseImage.POSTGRES_16, ContainerModifier.NETWORK);
bastion.initAndStartBastion(testdb.getContainer().getNetwork());
populateDatabaseTestData();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class CDCPostgresSourceCaCertificateSslAcceptanceLegacyCtidTest extends C

@Override
protected BaseImage getServerImage() {
return BaseImage.POSTGRES_12_BULLSEYE;
return BaseImage.POSTGRES_12;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public Map<Object, Object> getCertificateConfiguration() {

@Override
protected BaseImage getServerImage() {
return BaseImage.POSTGRES_16_BULLSEYE;
return BaseImage.POSTGRES_16;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public Map<Object, Object> getCertificateConfiguration() {

@Override
protected BaseImage getServerImage() {
return BaseImage.POSTGRES_16_BULLSEYE;
return BaseImage.POSTGRES_16;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected FeatureFlags featureFlags() {

@Override
protected Database setupDatabase() throws Exception {
testdb = PostgresTestDatabase.in(BaseImage.POSTGRES_16_BULLSEYE, ContainerModifier.CONF)
testdb = PostgresTestDatabase.in(BaseImage.POSTGRES_16, ContainerModifier.CONF)
.with("CREATE EXTENSION hstore;")
.with("CREATE SCHEMA TEST;")
.with("CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy');")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class CdcPostgresSourceAcceptanceLegacyCtidTest extends CdcPostgresSource

@Override
protected BaseImage getServerImage() {
return BaseImage.POSTGRES_12_BULLSEYE;
return BaseImage.POSTGRES_12;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private void verifyFieldNotExist(final List<AirbyteRecordMessage> records, final
}

protected BaseImage getServerImage() {
return BaseImage.POSTGRES_16_BULLSEYE;
return BaseImage.POSTGRES_16;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected FeatureFlags featureFlags() {

@Override
protected Database setupDatabase() {
testdb = PostgresTestDatabase.in(BaseImage.POSTGRES_16_BULLSEYE, ContainerModifier.CONF)
testdb = PostgresTestDatabase.in(BaseImage.POSTGRES_16, ContainerModifier.CONF)
.with("CREATE EXTENSION hstore;")
.with("CREATE SCHEMA TEST;")
.with("CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy');")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected FeatureFlags featureFlags() {

@Override
protected void setupEnvironment(final TestDestinationEnv environment) throws Exception {
testdb = PostgresTestDatabase.in(BaseImage.POSTGRES_16_BULLSEYE, ContainerModifier.CERT);
testdb = PostgresTestDatabase.in(BaseImage.POSTGRES_16, ContainerModifier.CERT);
testdb.query(ctx -> {
ctx.fetch("CREATE TABLE id_and_name(id INTEGER, name VARCHAR(200));");
ctx.fetch("INSERT INTO id_and_name (id, name) VALUES (1,'picard'), (2, 'crusher'), (3, 'vash');");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class PostgresSourceAcceptanceLegacyCtidTest extends PostgresSourceAccept

@Override
protected BaseImage getServerImage() {
return BaseImage.POSTGRES_12_BULLSEYE;
return BaseImage.POSTGRES_12;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ private ConfiguredAirbyteCatalog getLimitPermissionConfiguredCatalog() {
}

protected BaseImage getServerImage() {
return BaseImage.POSTGRES_16_BULLSEYE;
return BaseImage.POSTGRES_16;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected FeatureFlags featureFlags() {

@Override
protected Database setupDatabase() throws SQLException {
testdb = PostgresTestDatabase.in(BaseImage.POSTGRES_16_BULLSEYE, ContainerModifier.CONF)
testdb = PostgresTestDatabase.in(BaseImage.POSTGRES_16, ContainerModifier.CONF)
.with("CREATE SCHEMA %S;", SCHEMA_NAME)
.with("CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy');")
.with("CREATE TYPE inventory_item AS (name text, supplier_id integer, price numeric);")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected FeatureFlags featureFlags() {

@Override
protected void setupEnvironment(final TestDestinationEnv environment) throws Exception {
testdb = PostgresTestDatabase.in(BaseImage.POSTGRES_12_BULLSEYE)
testdb = PostgresTestDatabase.in(BaseImage.POSTGRES_12)
.with("CREATE TABLE id_and_name(id INTEGER, name VARCHAR(200));")
.with("INSERT INTO id_and_name (id, name) VALUES (1,'picard'), (2, 'crusher'), (3, 'vash');")
.with("CREATE TABLE starships(id INTEGER, name VARCHAR(200));")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ protected void compareTargetPositionFromTheRecordsWithTargetPostionGeneratedBefo
}

protected static BaseImage getServerImage() {
return BaseImage.POSTGRES_16_BULLSEYE;
return BaseImage.POSTGRES_16;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class CloudDeploymentPostgresSourceTest {

@BeforeAll
static void setupContainers() {
DB_NO_SSL_WITH_NETWORK = PostgresTestDatabase.in(BaseImage.POSTGRES_16_BULLSEYE, ContainerModifier.NETWORK);
DB_NO_SSL_WITH_NETWORK = PostgresTestDatabase.in(BaseImage.POSTGRES_16, ContainerModifier.NETWORK);
NETWORK_NO_SSL = DB_NO_SSL_WITH_NETWORK.getContainer().getNetwork();
BASTION_NO_SSL = new SshBastionContainer();
BASTION_NO_SSL.initAndStartBastion(NETWORK_NO_SSL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class PostgresCdcGetPublicizedTablesTest {

@BeforeEach
void setup() {
testdb = PostgresTestDatabase.in(BaseImage.POSTGRES_16_BULLSEYE, ContainerModifier.CONF)
testdb = PostgresTestDatabase.in(BaseImage.POSTGRES_16, ContainerModifier.CONF)
.with("create table table_1 (id serial primary key, text_column text);")
.with("create table table_2 (id serial primary key, text_column text);")
.with("create table table_irrelevant (id serial primary key, text_column text);")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected PostgresSource source() {

@Override
protected PostgresTestDatabase createTestDatabase() {
return PostgresTestDatabase.in(BaseImage.POSTGRES_16_BULLSEYE);
return PostgresTestDatabase.in(BaseImage.POSTGRES_16);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class PostgresSourceOperationsTest {

@BeforeEach
public void init() {
testdb = PostgresTestDatabase.in(BaseImage.POSTGRES_16_BULLSEYE, ContainerModifier.CONF);
testdb = PostgresTestDatabase.in(BaseImage.POSTGRES_16, ContainerModifier.CONF);
}

@AfterEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class PostgresSourceTest {

@BeforeEach
void setup() {
testdb = PostgresTestDatabase.in(BaseImage.POSTGRES_16_BULLSEYE)
testdb = PostgresTestDatabase.in(BaseImage.POSTGRES_16)
.with("CREATE TABLE id_and_name(id NUMERIC(20, 10) NOT NULL, name VARCHAR(200) NOT NULL, power double precision NOT NULL, PRIMARY KEY (id));")
.with("CREATE INDEX i1 ON id_and_name (id);")
.with("INSERT INTO id_and_name (id, name, power) VALUES (1,'goku', 'Infinity'), (2, 'vegeta', 9000.1), ('NaN', 'piccolo', '-Infinity');")
Expand Down Expand Up @@ -225,7 +225,7 @@ public void testCanReadTablesAndColumnsWithDoubleQuotes() throws Exception {
public void testCanReadUtf8() throws Exception {
// force the db server to start with sql_ascii encoding to verify the source can read UTF8 even when
// default settings are in another encoding
try (final var asciiTestDB = PostgresTestDatabase.in(BaseImage.POSTGRES_16_BULLSEYE, ContainerModifier.ASCII)
try (final var asciiTestDB = PostgresTestDatabase.in(BaseImage.POSTGRES_16, ContainerModifier.ASCII)
.with("CREATE TABLE id_and_name(id INTEGER, name VARCHAR(200));")
.with("INSERT INTO id_and_name (id, name) VALUES (1,E'\\u2013 someutfstring'), (2, E'\\u2215');")) {
final var config = asciiTestDB.testConfigBuilder().withSchemas(SCHEMA_NAME).withoutSsl().build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class XminPostgresSourceTest {
protected PostgresTestDatabase testdb;

protected BaseImage getDatabaseImage() {
return BaseImage.POSTGRES_12_BULLSEYE;
return BaseImage.POSTGRES_12;
}

@BeforeEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class XminPostgresWithOldServerSourceTest extends XminPostgresSourceTest

@Override
protected BaseImage getDatabaseImage() {
return BaseImage.POSTGRES_9_ALPINE;
return BaseImage.POSTGRES_9;
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public class PostgresTestDatabase extends

public static enum BaseImage {

POSTGRES_16_BULLSEYE("postgres:16-bullseye"),
POSTGRES_12_BULLSEYE("postgres:12-bullseye"),
POSTGRES_9_ALPINE("postgres:9-alpine"),
POSTGRES_16("postgres:16-bullseye"),
POSTGRES_12("postgres:12-bullseye"),
POSTGRES_9("postgres:9-alpine"),
POSTGRES_SSL_DEV("marcosmarxm/postgres-ssl:dev");

private final String reference;
Expand Down

0 comments on commit be6585d

Please sign in to comment.