forked from quarkus-qe/quarkus-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change waiting strategy for PG imgs from RH registry till FW fixed
- Loading branch information
1 parent
6c00f4d
commit c4ca78c
Showing
13 changed files
with
172 additions
and
54 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
...al-applications/src/test/java/io/quarkus/ts/external/applications/AbstractTodoDemoIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
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.RestService; | ||
import io.quarkus.test.scenarios.annotations.DisabledOnNative; | ||
import io.restassured.http.ContentType; | ||
|
||
@DisabledOnNative(reason = "This scenario is using uber-jar, so it's incompatible with Native") | ||
public abstract class AbstractTodoDemoIT { | ||
protected static final String TODO_REPO = "https://github.com/quarkusio/todo-demo-app.git"; | ||
protected static final String VERSIONS = "-Dquarkus.platform.group-id=${QUARKUS_PLATFORM_GROUP-ID} -Dquarkus.platform.version=${QUARKUS_PLATFORM_VERSION} "; | ||
protected static final String DEFAULT_OPTIONS = " -DskipTests=true " + VERSIONS; | ||
|
||
protected abstract RestService getApp(); | ||
|
||
protected abstract RestService getReplaced(); | ||
|
||
@Test | ||
public void startsSuccessfully() { | ||
getApp().given() | ||
.contentType(ContentType.JSON) | ||
.body("{\"title\": \"Use Quarkus\", \"order\": 1, \"url\": \"https://quarkus.io\"}") | ||
.post("/api") | ||
.then() | ||
.statusCode(HttpStatus.SC_CREATED); | ||
} | ||
|
||
@Test | ||
public void replacedStartsSuccessfully() { | ||
getReplaced().given() | ||
.accept(ContentType.JSON) | ||
.get("/api") | ||
.then() | ||
.statusCode(HttpStatus.SC_OK) | ||
.body("$.size()", is(1)) | ||
.body("title[0]", is("Use Quarkus")); | ||
} | ||
} |
35 changes: 34 additions & 1 deletion
35
...l-applications/src/test/java/io/quarkus/ts/external/applications/OpenShiftTodoDemoIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,42 @@ | ||
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 TodoDemoIT { | ||
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 31 additions & 2 deletions
33
...va/io/quarkus/ts/hibernate/reactive/openshift/OpenShiftPostgresqlHibernateReactiveIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,37 @@ | ||
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.ts.hibernate.reactive.PostgresqlDatabaseHibernateReactiveIT; | ||
import io.quarkus.test.services.Container; | ||
import io.quarkus.test.services.QuarkusApplication; | ||
import io.quarkus.ts.hibernate.reactive.AbstractDatabaseHibernateReactiveIT; | ||
|
||
@OpenShiftScenario | ||
public class OpenShiftPostgresqlHibernateReactiveIT extends PostgresqlDatabaseHibernateReactiveIT { | ||
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; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 20 additions & 1 deletion
21
...t/java/io/quarkus/ts/reactive/rest/data/panache/OpenShiftPostgresqlPanacheResourceIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,26 @@ | ||
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 PostgresqlPanacheResourceIT { | ||
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); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters