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

[Fixes_kie_issues_1749] Switch dockerhub to a mirrored registry #3828

Merged
merged 1 commit into from
Jan 27, 2025
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
8 changes: 8 additions & 0 deletions kogito-build/kogito-build-no-bom-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@
<maven.repo.local>${session.request.localRepositoryPath.path}</maven.repo.local>
<maven.settings>${session.request.userSettingsFile.path}</maven.settings>
</systemPropertyVariables>
<environmentVariables>
<TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX>mirror.gcr.io/</TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX>
<TESTCONTAINERS_REUSE_ENABLE>true</TESTCONTAINERS_REUSE_ENABLE>
</environmentVariables>
<parallel>all</parallel>
</configuration>
</plugin>
Expand All @@ -354,6 +358,10 @@
<maven.settings>${session.request.userSettingsFile.path}</maven.settings>
<forkedProcessTimeoutInSeconds>1800</forkedProcessTimeoutInSeconds>
</systemPropertyVariables>
<environmentVariables>
<TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX>mirror.gcr.io/</TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX>
<TESTCONTAINERS_REUSE_ENABLE>true</TESTCONTAINERS_REUSE_ENABLE>
</environmentVariables>
<parallel>all</parallel>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.containers.wait.strategy.HostPortWaitStrategy;
import org.testcontainers.containers.wait.strategy.WaitAllStrategy;
import org.testcontainers.utility.DockerImageName;

import static org.kie.kogito.testcontainers.KogitoGenericContainer.getImageName;

/**
* PostgreSQL Container for Kogito examples.
Expand All @@ -40,7 +43,7 @@ public class KogitoPostgreSqlContainer extends PostgreSQLContainer<KogitoPostgre
private static final Logger LOGGER = LoggerFactory.getLogger(KogitoPostgreSqlContainer.class);

public KogitoPostgreSqlContainer() {
super(KogitoGenericContainer.getImageName(NAME));
super(DockerImageName.parse(getImageName(NAME)).asCompatibleSubstituteFor("postgres"));
withLogConsumer(getLogger());
withLogConsumer(new Slf4jLogConsumer(LOGGER));
withStartupTimeout(Constants.CONTAINER_START_TIMEOUT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ void shouldGetMapperPort() {
@Test
void shouldGetDockerImageName() {
assumeTrue(DockerClientFactory.instance().isDockerAvailable(), "Aborting test: docker env not found");
assertThat(container.getDockerImageName()).isEqualTo(System.getProperty(Constants.CONTAINER_NAME_PREFIX + KogitoMongoDBContainer.NAME));
assertThat(container.getDockerImageName()).isEqualTo(System.getenv("TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX") + System.getProperty(Constants.CONTAINER_NAME_PREFIX + KogitoMongoDBContainer.NAME));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ kogito.events.variables.enabled=false
kogito.events.processinstances.collection=testPICollection
kogito.events.usertasks.collection=testUTCollection
kogito.events.variables.collection=testVCollection
kogito.events.database=testDB
kogito.events.database=testDB

quarkus.mongodb.devservices.image-name=mirror.gcr.io/mongo:4.4
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ quarkus.swagger-ui.always-include=true
kogito.persistence.type=jdbc
kogito.persistence.proto.marshaller=false
quarkus.datasource.db-kind=postgresql
quarkus.datasource.devservices.image-name=mirror.gcr.io/postgres:15.9-alpine3.20
kie.flyway.enabled=true

quarkus.http.test-port=0
Expand Down Expand Up @@ -255,4 +256,4 @@ quarkus.http.auth.permission.default.policy=authenticated

quarkus.security.users.embedded.enabled=true
quarkus.security.users.embedded.plain-text=true
quarkus.security.users.embedded.users.buddy=buddy
quarkus.security.users.embedded.users.buddy=buddy
Original file line number Diff line number Diff line change
Expand Up @@ -73,58 +73,68 @@ public void testStartApprovalAuthorized() {
.then()
.statusCode(201)
.body("id", notNullValue()).extract().path("id");
// get all active approvals
given()
.accept(ContentType.JSON)
.when()
.get("/AddedTask")
.then()
.statusCode(200)
.body("size()", is(1), "[0].id", is(id));

// get just started approval
given()
.accept(ContentType.JSON)
.when()
.get("/AddedTask/" + id)
.then()
.statusCode(200)
.body("id", is(id));

// tasks assigned in just started approval

String userTaskId = given()
.basePath(USER_TASK_BASE_PATH)
.queryParam("user", "mary")
.queryParam("group", "managers")
.contentType(ContentType.JSON)
.when()
.get()
.then()
.statusCode(200)
.extract()
.body()
.path("[0].id");

given()
.contentType(ContentType.JSON)
.basePath(USER_TASK_BASE_PATH)
.queryParam("user", "mary")
.queryParam("group", "managers")
.body(new TransitionInfo("complete"))
.when()
.post("/{userTaskId}/transition", userTaskId)
.then()
.statusCode(200);

// get all active approvals
given()
.accept(ContentType.JSON)
.when()
.get("/AddedTask")
.then()
.statusCode(200)
.body("size()", is(1));
try {
gmunozfe marked this conversation as resolved.
Show resolved Hide resolved
// get all active approvals
given()
.accept(ContentType.JSON)
.when()
.get("/AddedTask")
.then()
.statusCode(200)
.body("size()", is(1), "[0].id", is(id));

// get just started approval
given()
.accept(ContentType.JSON)
.when()
.get("/AddedTask/" + id)
.then()
.statusCode(200)
.body("id", is(id));

// tasks assigned in just started approval

String userTaskId = given()
.basePath(USER_TASK_BASE_PATH)
.queryParam("user", "mary")
.queryParam("group", "managers")
.contentType(ContentType.JSON)
.when()
.get()
.then()
.statusCode(200)
.extract()
.body()
.path("[0].id");

given()
.contentType(ContentType.JSON)
.basePath(USER_TASK_BASE_PATH)
.queryParam("user", "mary")
.queryParam("group", "managers")
.body(new TransitionInfo("complete"))
.when()
.post("/{userTaskId}/transition", userTaskId)
.then()
.statusCode(200);

// get all active approvals
given()
.accept(ContentType.JSON)
.when()
.get("/AddedTask")
.then()
.statusCode(200)
.body("size()", is(1));
} finally {
// Cleanup: Remove the AddedTask
given()
.when()
.delete("/AddedTask/" + id)
.then()
.statusCode(200);
}
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
kogito.persistence.type=jdbc
#run create tables scripts
quarkus.datasource.db-kind=postgresql
quarkus.datasource.devservices.image-name=mirror.gcr.io/postgres:15.9-alpine3.20

kie.flyway.enabled=true
kie.flyway.enabled=true
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
#

kogito.persistence.type=postgresql
quarkus.datasource.devservices.image-name=mirror.gcr.io/postgres:15.9-alpine3.20

kie.flyway.enabled=true
kie.flyway.enabled=true
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
#

quarkus.datasource.db-kind=postgresql
quarkus.datasource.devservices.image-name=mirror.gcr.io/postgres:15.9-alpine3.20

kogito.persistence.type=jdbc

kie.flyway.enabled=true
kie.flyway.enabled=true
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ void shouldConditionalBeEnabled() {
@Test
void shouldGetDockerImageName() {
givenResource();
assertEquals(System.getProperty(Constants.CONTAINER_NAME_PREFIX + KogitoMongoDBContainer.NAME), resource.getTestResource().getDockerImageName());
assertEquals(System.getenv("TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX") + System.getProperty(Constants.CONTAINER_NAME_PREFIX + KogitoMongoDBContainer.NAME),
resource.getTestResource().getDockerImageName());
}

private void givenConditionalResource() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ void shouldConditionalBeEnabled() {
@Test
void shouldGetDockerImageName() {
givenResource();
assertEquals(System.getProperty(Constants.CONTAINER_NAME_PREFIX + KogitoMongoDBContainer.NAME), resource.getTestResource().getDockerImageName());
assertEquals(System.getenv("TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX") + System.getProperty(Constants.CONTAINER_NAME_PREFIX + KogitoMongoDBContainer.NAME),
resource.getTestResource().getDockerImageName());
}

private void givenConditionalResource() {
Expand Down
Loading