diff --git a/.github/workflows/verify.yaml b/.github/workflows/verify.yaml index bf230c471..5c38c6703 100644 --- a/.github/workflows/verify.yaml +++ b/.github/workflows/verify.yaml @@ -99,16 +99,3 @@ jobs: if: github.event_name == 'pull_request' uses: eclipse-edc/.github/.github/workflows/verify-openapi.yml@main secrets: inherit - - Verify-IH-BOM: - strategy: - fail-fast: false - - # we can't test the "controlplane-oauth2-com" because it only starts successfully if the public key is already in the vault - matrix: - bom-directory: [ "dist/bom/identityhub-bom", - "dist/bom/identityhub-with-sts-bom" ] - uses: eclipse-edc/.github/.github/workflows/verify-bom.yml@main - with: - module-dir: ${{ matrix.bom-directory }} - properties-file: example.properties diff --git a/dist/bom/identityhub-bom/example.properties b/dist/bom/identityhub-bom/example.properties deleted file mode 100644 index 472fe5f2f..000000000 --- a/dist/bom/identityhub-bom/example.properties +++ /dev/null @@ -1,10 +0,0 @@ -edc.ih.iam.id=did:web:test -edc.ih.iam.publickey.path=/some/path/to/key.pem -web.http.presentation.port=10001 -web.http.presentation.path=/api/resolution -web.http.identity.port=8080 -web.http.identity.path=/api/identity -web.http.port=8181 -web.http.path=/api/v1/ -edc.sts.account.api.url=https://sts.com/accounts -edc.sts.accounts.api.auth.header.value=password \ No newline at end of file diff --git a/dist/bom/identityhub-with-sts-bom/example.properties b/dist/bom/identityhub-with-sts-bom/example.properties deleted file mode 100644 index 96c04bb98..000000000 --- a/dist/bom/identityhub-with-sts-bom/example.properties +++ /dev/null @@ -1,13 +0,0 @@ -edc.ih.iam.id=did:web:test -edc.ih.iam.publickey.path=/some/path/to/key.pem -web.http.presentation.port=10001 -web.http.presentation.path=/api/resolution -web.http.identity.port=8080 -web.http.identity.path=/api/identity -web.http.port=8181 -web.http.path=/api/v1/ -web.http.sts.port=8090 -web.http.sts.path=/api/sts -web.http.accounts.port=8091 -web.http.accounts.path=/api/accounts -edc.api.accounts.key=some-auth-key \ No newline at end of file diff --git a/e2e-tests/bom-tests/build.gradle.kts b/e2e-tests/bom-tests/build.gradle.kts new file mode 100644 index 000000000..27d41d77d --- /dev/null +++ b/e2e-tests/bom-tests/build.gradle.kts @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * + */ + +plugins { + java +} + +dependencies { + testImplementation(libs.edc.junit) + testImplementation(libs.restAssured) + testImplementation(libs.assertj) + testImplementation(libs.awaitility) +} + +edcBuild { + publish.set(false) +} diff --git a/e2e-tests/bom-tests/src/test/java/org/eclipse/edc/test/bom/BomSmokeTests.java b/e2e-tests/bom-tests/src/test/java/org/eclipse/edc/test/bom/BomSmokeTests.java new file mode 100644 index 000000000..b1011f6cf --- /dev/null +++ b/e2e-tests/bom-tests/src/test/java/org/eclipse/edc/test/bom/BomSmokeTests.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * + */ + +package org.eclipse.edc.test.bom; + + +import org.eclipse.edc.junit.annotations.EndToEndTest; +import org.eclipse.edc.junit.extensions.EmbeddedRuntime; +import org.eclipse.edc.junit.extensions.RuntimeExtension; +import org.eclipse.edc.junit.extensions.RuntimePerMethodExtension; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import java.util.HashMap; +import java.util.Map; + +import static io.restassured.RestAssured.given; +import static java.lang.String.valueOf; +import static org.awaitility.Awaitility.await; +import static org.eclipse.edc.util.io.Ports.getFreePort; +import static org.hamcrest.Matchers.equalTo; + + +public class BomSmokeTests { + abstract static class SmokeTest { + public static final String DEFAULT_PORT = "8080"; + public static final String DEFAULT_PATH = "/api"; + + @Test + void assertRuntimeReady() { + await().untilAsserted(() -> given() + .baseUri("http://localhost:" + DEFAULT_PORT + DEFAULT_PATH + "/check/startup") + .get() + .then() + .statusCode(200) + .log().ifValidationFails() + .body("isSystemHealthy", equalTo(true))); + + } + } + + @Nested + @EndToEndTest + class IdentityHub extends SmokeTest { + + @RegisterExtension + protected RuntimeExtension runtime = + new RuntimePerMethodExtension(new EmbeddedRuntime("identityhub-bom", + Map.of( + "web.http.port", DEFAULT_PORT, + "web.http.path", DEFAULT_PATH, + "edc.ih.iam.id", "did:web:test", + "edc.ih.iam.publickey.path", "/some/path/to/key.pem", + "web.http.presentation.port", valueOf(getFreePort()), + "web.http.presentation.path", "/api/resolution", + "web.http.identity.port", valueOf(getFreePort()), + "web.http.identity.path", "/api/identity", + "edc.sts.account.api.url", "https://sts.com/accounts", + "edc.sts.accounts.api.auth.header.value", "password"), + ":dist:bom:identityhub-bom" + )); + } + + @Nested + @EndToEndTest + class IdentityHubWithSts extends SmokeTest { + + @RegisterExtension + protected RuntimeExtension runtime = + new RuntimePerMethodExtension(new EmbeddedRuntime("identityhub-with-sts-bom", + new HashMap<>() { + { + put("web.http.port", DEFAULT_PORT); + put("web.http.path", DEFAULT_PATH); + put("edc.ih.iam.id", "did:web:test"); + put("edc.ih.iam.publickey.path", "/some/path/to/key.pem"); + put("web.http.presentation.port", valueOf(getFreePort())); + put("web.http.presentation.path", "/api/resolution"); + put("web.http.identity.port", valueOf(getFreePort())); + put("web.http.identity.path", "/api/identity"); + put("web.http.accounts.port", valueOf(getFreePort())); + put("web.http.accounts.path", "/api/accounts"); + put("edc.api.accounts.key", "password"); + } + }, + ":dist:bom:identityhub-with-sts-bom" + )); + } +} diff --git a/settings.gradle.kts b/settings.gradle.kts index b5c0bfac7..b6ff9ab8e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -74,6 +74,7 @@ include(":e2e-tests:api-tests") include(":e2e-tests:sts-tests") include(":e2e-tests:runtimes:identityhub-remote-sts") include(":e2e-tests:runtimes:sts") +include(":e2e-tests:bom-tests") // BOM modules include(":dist:bom:identityhub-base-bom")