From 557d280a19d1e49fa30f431261416ff621eaaa2f Mon Sep 17 00:00:00 2001 From: pablo gonzalez granados Date: Wed, 1 Mar 2023 18:04:59 +0100 Subject: [PATCH] Due to a test framework issue we are going to reuse postgres docker container image --- .../quarkus/ts/sqldb/sqlapp/PostgresqlDatabaseIT.java | 10 ++++++---- .../java/io/quarkus/ts/sqldb/sqlapp/XAPostgresIT.java | 10 ++++++---- sql-db/sql-app/src/test/resources/test.properties | 2 ++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/sql-db/sql-app/src/test/java/io/quarkus/ts/sqldb/sqlapp/PostgresqlDatabaseIT.java b/sql-db/sql-app/src/test/java/io/quarkus/ts/sqldb/sqlapp/PostgresqlDatabaseIT.java index e10bb36f7..b4a2aee60 100644 --- a/sql-db/sql-app/src/test/java/io/quarkus/ts/sqldb/sqlapp/PostgresqlDatabaseIT.java +++ b/sql-db/sql-app/src/test/java/io/quarkus/ts/sqldb/sqlapp/PostgresqlDatabaseIT.java @@ -11,8 +11,10 @@ public class PostgresqlDatabaseIT extends AbstractSqlDatabaseIT { static final int POSTGRESQL_PORT = 5432; + // TODO rename "postgresql" database to "database" once this issue is fixed + // quarkus-qe/quarkus-test-framework#641 @Container(image = "${postgresql.latest.image}", port = POSTGRESQL_PORT, expectedLog = "listening on IPv4 address") - static PostgresqlService database = new PostgresqlService() + static PostgresqlService postgresql = new PostgresqlService() //fixme https://github.com/quarkus-qe/quarkus-test-framework/issues/455 .withProperty("POSTGRES_USER", "user") .withProperty("POSTGRES_PASSWORD", "user") @@ -20,7 +22,7 @@ public class PostgresqlDatabaseIT extends AbstractSqlDatabaseIT { @QuarkusApplication static RestService app = new RestService().withProperties("postgresql.properties") - .withProperty("quarkus.datasource.username", database.getUser()) - .withProperty("quarkus.datasource.password", database.getPassword()) - .withProperty("quarkus.datasource.jdbc.url", database::getJdbcUrl); + .withProperty("quarkus.datasource.username", postgresql.getUser()) + .withProperty("quarkus.datasource.password", postgresql.getPassword()) + .withProperty("quarkus.datasource.jdbc.url", postgresql::getJdbcUrl); } diff --git a/sql-db/sql-app/src/test/java/io/quarkus/ts/sqldb/sqlapp/XAPostgresIT.java b/sql-db/sql-app/src/test/java/io/quarkus/ts/sqldb/sqlapp/XAPostgresIT.java index 19d2a804e..daf1866d0 100644 --- a/sql-db/sql-app/src/test/java/io/quarkus/ts/sqldb/sqlapp/XAPostgresIT.java +++ b/sql-db/sql-app/src/test/java/io/quarkus/ts/sqldb/sqlapp/XAPostgresIT.java @@ -11,16 +11,18 @@ public class XAPostgresIT extends AbstractSqlDatabaseIT { static final int POSTGRESQL_PORT = 5432; + // TODO rename "postgresql" database to "database" once this issue is fixed + // quarkus-qe/quarkus-test-framework#641 @Container(image = "${postgresql.latest.image}", port = POSTGRESQL_PORT, expectedLog = "listening on IPv4 address") - static PostgresqlService database = new PostgresqlService() + static PostgresqlService postgresql = new PostgresqlService() .withUser("user") .withPassword("user") .withDatabase("mydb"); @QuarkusApplication static RestService app = new RestService().withProperties("postgresql.properties") - .withProperty("quarkus.datasource.username", database.getUser()) - .withProperty("quarkus.datasource.password", database.getPassword()) + .withProperty("quarkus.datasource.username", postgresql.getUser()) + .withProperty("quarkus.datasource.password", postgresql.getPassword()) .withProperty("quarkus.datasource.jdbc.transactions", "xa") - .withProperty("quarkus.datasource.jdbc.url", database::getJdbcUrl); + .withProperty("quarkus.datasource.jdbc.url", postgresql::getJdbcUrl); } diff --git a/sql-db/sql-app/src/test/resources/test.properties b/sql-db/sql-app/src/test/resources/test.properties index d2aa526f5..e689279a5 100644 --- a/sql-db/sql-app/src/test/resources/test.properties +++ b/sql-db/sql-app/src/test/resources/test.properties @@ -1,6 +1,8 @@ ts.app.log.enable=true ts.database.log.enable=true +ts.postgresql.log.enable=true ts.database.container.delete.image.on.stop=true ts.database.openshift.use-internal-service-as-url=true +ts.postgresql.openshift.use-internal-service-as-url=true ts.db2.container.privileged-mode=true ts.db2.startup.timeout=10m \ No newline at end of file