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

Revert "Change waiting strategy for PG imgs from RH registry till FW is fixed" #2007

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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,42 +1,9 @@
package io.quarkus.ts.external.applications;

import io.quarkus.test.bootstrap.PostgresqlService;
import io.quarkus.test.bootstrap.RestService;
import io.quarkus.test.scenarios.OpenShiftScenario;
import io.quarkus.test.scenarios.annotations.DisabledOnNative;
import io.quarkus.test.services.Container;
import io.quarkus.test.services.GitRepositoryQuarkusApplication;

@DisabledOnNative(reason = "Native + s2i not supported")
@OpenShiftScenario
public class OpenShiftTodoDemoIT extends AbstractTodoDemoIT {

// FIXME: change expected log when https://github.com/quarkus-qe/quarkus-test-framework/issues/1183 is fixed
@Container(image = "${postgresql.latest.image}", port = 5432, expectedLog = "Future log output will appear in directory")
static PostgresqlService database = new PostgresqlService()
// store data in /tmp/psql as in OpenShift we don't have permissions to /var/lib/postgresql/data
.withProperty("PGDATA", "/tmp/psql");

@GitRepositoryQuarkusApplication(repo = TODO_REPO, mavenArgs = "-Dquarkus.package.jar.type=uber-jar" + DEFAULT_OPTIONS)
static final RestService app = new RestService()
.withProperty("quarkus.datasource.username", database.getUser())
.withProperty("quarkus.datasource.password", database.getPassword())
.withProperty("quarkus.datasource.jdbc.url", database::getJdbcUrl);

@GitRepositoryQuarkusApplication(repo = TODO_REPO, artifact = "todo-backend-1.0-SNAPSHOT.jar", mavenArgs = "-Dquarkus.package.jar.type=uber-jar -Dquarkus.package.add-runner-suffix=false"
+ DEFAULT_OPTIONS)
static final RestService replaced = new RestService()
.withProperty("quarkus.datasource.username", database.getUser())
.withProperty("quarkus.datasource.password", database.getPassword())
.withProperty("quarkus.datasource.jdbc.url", database::getJdbcUrl);

@Override
protected RestService getApp() {
return app;
}

@Override
protected RestService getReplaced() {
return replaced;
}
public class OpenShiftTodoDemoIT extends TodoDemoIT {
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ public class OpenShiftWorkshopHeroesIT {

private static final int POSTGRESQL_PORT = 5432;

// FIXME: change expected log when https://github.com/quarkus-qe/quarkus-test-framework/issues/1183 is fixed
@Container(image = "${postgresql.latest.image}", port = POSTGRESQL_PORT, expectedLog = "Future log output will appear in directory")
@Container(image = "${postgresql.latest.image}", port = POSTGRESQL_PORT, expectedLog = "listening on IPv4 address")
static PostgresqlService database = new PostgresqlService()
.withProperty("PGDATA", "/tmp/psql");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ public class OpenShiftWorkshopVillainsIT {

private static final int POSTGRESQL_PORT = 5432;

// FIXME: change expected log when https://github.com/quarkus-qe/quarkus-test-framework/issues/1183 is fixed
@Container(image = "${postgresql.latest.image}", port = POSTGRESQL_PORT, expectedLog = "Future log output will appear in directory")
@Container(image = "${postgresql.latest.image}", port = POSTGRESQL_PORT, expectedLog = "listening on IPv4 address")
static PostgresqlService database = new PostgresqlService()
.withProperty("PGDATA", "/tmp/psql");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
package io.quarkus.ts.external.applications;

import static org.hamcrest.Matchers.is;

import org.apache.http.HttpStatus;
import org.junit.jupiter.api.Test;

import io.quarkus.test.bootstrap.PostgresqlService;
import io.quarkus.test.bootstrap.RestService;
import io.quarkus.test.scenarios.QuarkusScenario;
import io.quarkus.test.scenarios.annotations.DisabledOnNative;
import io.quarkus.test.services.Container;
import io.quarkus.test.services.GitRepositoryQuarkusApplication;
import io.restassured.http.ContentType;

@DisabledOnNative(reason = "This scenario is using uber-jar, so it's incompatible with Native")
@QuarkusScenario
public class TodoDemoIT extends AbstractTodoDemoIT {
public class TodoDemoIT {
private static final String TODO_REPO = "https://github.com/quarkusio/todo-demo-app.git";
private static final String VERSIONS = "-Dquarkus.platform.group-id=${QUARKUS_PLATFORM_GROUP-ID} -Dquarkus.platform.version=${QUARKUS_PLATFORM_VERSION} ";
private static final String DEFAULT_OPTIONS = " -DskipTests=true " + VERSIONS;

@Container(image = "${postgresql.latest.image}", port = 5432, expectedLog = "listening on IPv4 address")
static PostgresqlService database = new PostgresqlService()
Expand All @@ -27,13 +38,24 @@ public class TodoDemoIT extends AbstractTodoDemoIT {
.withProperty("quarkus.datasource.password", database.getPassword())
.withProperty("quarkus.datasource.jdbc.url", database::getJdbcUrl);

@Override
protected RestService getApp() {
return app;
@Test
public void startsSuccessfully() {
app.given()
.contentType(ContentType.JSON)
.body("{\"title\": \"Use Quarkus\", \"order\": 1, \"url\": \"https://quarkus.io\"}")
.post("/api")
.then()
.statusCode(HttpStatus.SC_CREATED);
}

@Override
protected RestService getReplaced() {
return replaced;
@Test
public void replacedStartsSuccessfully() {
replaced.given()
.accept(ContentType.JSON)
.get("/api")
.then()
.statusCode(HttpStatus.SC_OK)
.body("$.size()", is(1))
.body("title[0]", is("Use Quarkus"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
public class AbstractDbIT {
static final int POSTGRESQL_PORT = 5432;

// FIXME: here PG image must not be hardcoded, we need to use ${postgresql.latest.image} system property;
// however using Red Hat image here would require a lot of refactoring
// we need to address https://github.com/quarkus-qe/quarkus-test-framework/issues/1183 first
@Container(image = "docker.io/postgres:16.1", port = POSTGRESQL_PORT, expectedLog = "listening on IPv4 address")
@Container(image = "${postgresql.latest.image}", port = POSTGRESQL_PORT, expectedLog = "listening on IPv4 address")
static final PostgresqlService database = new PostgresqlService()
.withProperty("PGDATA", "/tmp/psql");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,8 @@
package io.quarkus.ts.hibernate.reactive.openshift;

import io.quarkus.test.bootstrap.PostgresqlService;
import io.quarkus.test.bootstrap.RestService;
import io.quarkus.test.scenarios.OpenShiftScenario;
import io.quarkus.test.services.Container;
import io.quarkus.test.services.QuarkusApplication;
import io.quarkus.ts.hibernate.reactive.AbstractDatabaseHibernateReactiveIT;
import io.quarkus.ts.hibernate.reactive.PostgresqlDatabaseHibernateReactiveIT;

@OpenShiftScenario
public class OpenShiftPostgresqlHibernateReactiveIT extends AbstractDatabaseHibernateReactiveIT {

private static final String POSTGRES_USER = "quarkus_test";
private static final String POSTGRES_PASSWORD = "quarkus_test";
private static final String POSTGRES_DATABASE = "quarkus_test";
private static final int POSTGRES_PORT = 5432;

// FIXME: change expected log when https://github.com/quarkus-qe/quarkus-test-framework/issues/1183 is fixed
@Container(image = "${postgresql.latest.image}", port = POSTGRES_PORT, expectedLog = "Future log output will appear in directory")
static PostgresqlService database = new PostgresqlService()
.withUser(POSTGRES_USER)
.withPassword(POSTGRES_PASSWORD)
.withDatabase(POSTGRES_DATABASE)
.withProperty("PGDATA", "/tmp/psql");

@QuarkusApplication
static RestService app = new RestService().withProperties("postgresql.properties")
.withProperty("quarkus.datasource.username", POSTGRES_USER)
.withProperty("quarkus.datasource.password", POSTGRES_PASSWORD)
.withProperty("quarkus.datasource.reactive.url", database::getReactiveUrl);

@Override
protected RestService getApp() {
return app;
}

public class OpenShiftPostgresqlHibernateReactiveIT extends PostgresqlDatabaseHibernateReactiveIT {
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ public class OpenShiftMultiplePersistenceIT extends AbstractMultiplePersistenceI
@Container(image = "${mariadb.103.image}", port = MYSQL_PORT, expectedLog = "Only MySQL server logs after this point")
static MariaDbService mariadb = new MariaDbService();

// FIXME: change expected log when https://github.com/quarkus-qe/quarkus-test-framework/issues/1183 is fixed
@Container(image = "${postgresql.latest.image}", port = POSTGRESQL_PORT, expectedLog = "Future log output will appear in directory")
@Container(image = "${postgresql.latest.image}", port = POSTGRESQL_PORT, expectedLog = "listening on IPv4 address")
static PostgresqlService postgresql = new PostgresqlService()
.withProperty("PGDATA", "/tmp/psql");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
@OpenShiftScenario
public class OpenShiftPostgresqlTransactionGeneralUsageIT extends AbstractPostgresqlTransactionGeneralUsageIT {

// FIXME: change expected log when https://github.com/quarkus-qe/quarkus-test-framework/issues/1183 is fixed
@Container(image = "${postgresql.latest.image}", port = POSTGRESQL_PORT, expectedLog = "Future log output will appear in directory")
@Container(image = "${postgresql.latest.image}", port = POSTGRESQL_PORT, expectedLog = "listening on IPv4 address")
static final PostgresqlService database = new PostgresqlService()
// following env variable is accepted by PG images from Red Hat registry
.withProperty("POSTGRESQL_MAX_PREPARED_TRANSACTIONS", "100")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,7 @@
package io.quarkus.ts.reactive.rest.data.panache;

import io.quarkus.test.bootstrap.PostgresqlService;
import io.quarkus.test.bootstrap.RestService;
import io.quarkus.test.scenarios.OpenShiftScenario;
import io.quarkus.test.services.Container;
import io.quarkus.test.services.QuarkusApplication;

@OpenShiftScenario
public class OpenShiftPostgresqlPanacheResourceIT extends AbstractPanacheResourceIT {

private static final int POSTGRESQL_PORT = 5432;

// FIXME: change expected log when https://github.com/quarkus-qe/quarkus-test-framework/issues/1183 is fixed
@Container(image = "${postgresql.latest.image}", port = POSTGRESQL_PORT, expectedLog = "Future log output will appear in directory")
public static final PostgresqlService database = new PostgresqlService()
.withProperty("POSTGRES_DB", "mydb")
.withProperty("PGDATA", "/tmp/psql");

@QuarkusApplication
public static final 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);

public class OpenShiftPostgresqlPanacheResourceIT extends PostgresqlPanacheResourceIT {
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@QuarkusScenario
public class PostgresqlPanacheResourceIT extends AbstractPanacheResourceIT {

private static final int POSTGRESQL_PORT = 5432;
static final int POSTGRESQL_PORT = 5432;

@Container(image = "${postgresql.latest.image}", port = POSTGRESQL_PORT, expectedLog = "listening on IPv4 address")
public static final PostgresqlService database = new PostgresqlService()
Expand All @@ -21,5 +21,4 @@ public class PostgresqlPanacheResourceIT extends AbstractPanacheResourceIT {
.withProperty("quarkus.datasource.username", database.getUser())
.withProperty("quarkus.datasource.password", database.getPassword())
.withProperty("quarkus.datasource.jdbc.url", database::getJdbcUrl);

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ public class OpenShiftPostgresqlDatabaseIT extends AbstractSqlDatabaseIT {

static final int POSTGRESQL_PORT = 5432;

// FIXME: change expected log when https://github.com/quarkus-qe/quarkus-test-framework/issues/1183 is fixed
@Container(image = "${postgresql.latest.image}", port = POSTGRESQL_PORT, expectedLog = "Future log output will appear in directory")
@Container(image = "${postgresql.latest.image}", port = POSTGRESQL_PORT, expectedLog = "listening on IPv4 address")
static PostgresqlService database = new PostgresqlService()
.withProperty("PGDATA", "/tmp/psql");

Expand Down