Skip to content

Commit

Permalink
Due to a test framework issue we are going to reuse postgres docker c…
Browse files Browse the repository at this point in the history
…ontainer image
  • Loading branch information
pablo gonzalez granados committed Mar 2, 2023
1 parent e01fc39 commit 557d280
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ 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")
.withProperty("POSTGRES_DB", "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.jdbc.url", database::getJdbcUrl);
.withProperty("quarkus.datasource.username", postgresql.getUser())
.withProperty("quarkus.datasource.password", postgresql.getPassword())
.withProperty("quarkus.datasource.jdbc.url", postgresql::getJdbcUrl);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 2 additions & 0 deletions sql-db/sql-app/src/test/resources/test.properties
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 557d280

Please sign in to comment.