Skip to content

Commit d914d18

Browse files
feat(ci): use E2E tests for BOM Smoke tests (#259)
1 parent 8131f84 commit d914d18

File tree

4 files changed

+101
-12
lines changed

4 files changed

+101
-12
lines changed

.github/workflows/verify.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,3 @@ jobs:
125125
if: github.event_name == 'pull_request'
126126
uses: eclipse-edc/.github/.github/workflows/verify-openapi.yml@main
127127
secrets: inherit
128-
129-
Verify-FC-BOM:
130-
strategy:
131-
fail-fast: false
132-
133-
# we can't test the "controlplane-oauth2-com" because it only starts successfully if the public key is already in the vault
134-
matrix:
135-
bom-directory: [ "dist/bom/federatedcatalog-dcp-bom" ]
136-
uses: eclipse-edc/.github/.github/workflows/verify-bom.yml@main
137-
with:
138-
module-dir: ${{ matrix.bom-directory }}
139-
properties-file: example.properties

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ include(":launchers:catalog-mocked")
1515
include(":system-tests:component-tests")
1616
include(":system-tests:end2end-test:connector-runtime")
1717
include(":system-tests:end2end-test:e2e-junit-runner")
18+
include(":system-tests:bom-tests")
1819
include(":version-catalog")
1920

2021
// BOM modules
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
3+
*
4+
* This program and the accompanying materials are made available under the
5+
* terms of the Apache License, Version 2.0 which is available at
6+
* https://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* SPDX-License-Identifier: Apache-2.0
9+
*
10+
* Contributors:
11+
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
12+
*
13+
*/
14+
15+
plugins {
16+
java
17+
}
18+
19+
dependencies {
20+
testImplementation(libs.edc.junit)
21+
testImplementation(libs.restAssured)
22+
testImplementation(libs.assertj)
23+
testImplementation(libs.awaitility)
24+
}
25+
26+
edcBuild {
27+
publish.set(false)
28+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*
2+
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
3+
*
4+
* This program and the accompanying materials are made available under the
5+
* terms of the Apache License, Version 2.0 which is available at
6+
* https://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* SPDX-License-Identifier: Apache-2.0
9+
*
10+
* Contributors:
11+
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
12+
*
13+
*/
14+
15+
package org.eclipse.edc.test.bom;
16+
17+
18+
import org.eclipse.edc.junit.annotations.EndToEndTest;
19+
import org.eclipse.edc.junit.extensions.EmbeddedRuntime;
20+
import org.eclipse.edc.junit.extensions.RuntimeExtension;
21+
import org.eclipse.edc.junit.extensions.RuntimePerMethodExtension;
22+
import org.junit.jupiter.api.Nested;
23+
import org.junit.jupiter.api.Test;
24+
import org.junit.jupiter.api.extension.RegisterExtension;
25+
26+
import java.util.Map;
27+
28+
import static io.restassured.RestAssured.given;
29+
import static org.awaitility.Awaitility.await;
30+
import static org.hamcrest.Matchers.equalTo;
31+
32+
33+
public class BomSmokeTests {
34+
abstract static class SmokeTest {
35+
public static final String DEFAULT_PORT = "8080";
36+
public static final String DEFAULT_PATH = "/api";
37+
38+
@Test
39+
void assertRuntimeReady() {
40+
await().untilAsserted(() -> given()
41+
.baseUri("http://localhost:" + DEFAULT_PORT + DEFAULT_PATH + "/check/startup")
42+
.get()
43+
.then()
44+
.statusCode(200)
45+
.log().ifValidationFails()
46+
.body("isSystemHealthy", equalTo(true)));
47+
48+
}
49+
}
50+
51+
@Nested
52+
@EndToEndTest
53+
class FederatedCatalogDcp extends SmokeTest {
54+
55+
@RegisterExtension
56+
protected RuntimeExtension runtime =
57+
new RuntimePerMethodExtension(new EmbeddedRuntime("fc-dcp-bom",
58+
Map.of(
59+
"edc.iam.sts.oauth.token.url", "https://sts.com/token",
60+
"edc.iam.sts.oauth.client.id", "test-clientid",
61+
"edc.iam.sts.oauth.client.secret.alias", "test-alias",
62+
"web.http.port", "8080",
63+
"web.http.path", "/api",
64+
"web.http.catalog.port", "8081",
65+
"web.http.catalog.path", "/api/catalog",
66+
"edc.catalog.cache.execution.period.seconds", "5",
67+
"edc.catalog.cache.execution.delay.seconds", "0"),
68+
":dist:bom:federatedcatalog-dcp-bom"
69+
));
70+
}
71+
72+
}

0 commit comments

Comments
 (0)