Skip to content

Commit a26b02b

Browse files
alesjbschuhmann
authored andcommitted
Fix IT / native test(s), add it to native-tests run
1 parent dcc29ac commit a26b02b

File tree

8 files changed

+29
-10
lines changed

8 files changed

+29
-10
lines changed

.github/native-tests.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
{
118118
"category": "Misc4",
119119
"timeout": 130,
120-
"test-modules": "picocli-native, gradle, micrometer-mp-metrics, micrometer-prometheus, logging-json, jaxp, jaxb, opentelemetry, opentelemetry-jdbc-instrumentation, opentelemetry-mongodb-client-instrumentation, opentelemetry-redis-instrumentation, web-dependency-locator",
120+
"test-modules": "picocli-native, gradle, micrometer-mp-metrics, micrometer-prometheus, logging-json, jaxp, jaxb, observability-lgtm, opentelemetry, opentelemetry-jdbc-instrumentation, opentelemetry-mongodb-client-instrumentation, opentelemetry-redis-instrumentation, web-dependency-locator",
121121
"os-name": "ubuntu-latest"
122122
},
123123
{
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package io.quarkus.observability.test;
2+
3+
import org.eclipse.microprofile.config.inject.ConfigProperty;
4+
5+
public abstract class LgtmConfigTestBase extends LgtmTestBase {
6+
7+
@ConfigProperty(name = "grafana.endpoint")
8+
String endpoint;
9+
10+
@Override
11+
protected String grafanaEndpoint() {
12+
return endpoint;
13+
}
14+
}

integration-tests/observability-lgtm/src/test/java/io/quarkus/observability/test/LgtmGrpcTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
@QuarkusTest
1616
@TestProfile(LgtmGrpcTest.GrpcTestProfileOnly.class)
1717
@DisabledOnOs(OS.WINDOWS)
18-
public class LgtmGrpcTest extends LgtmTestBase {
18+
public class LgtmGrpcTest extends LgtmConfigTestBase {
1919

2020
public static class GrpcTestProfileOnly implements QuarkusTestProfile {
2121
@Override

integration-tests/observability-lgtm/src/test/java/io/quarkus/observability/test/LgtmLifecycleTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
@QuarkusTestResource(value = LgtmResource.class, restrictToAnnotatedClass = true)
1616
@TestProfile(LgtmLifecycleTest.TestResourceTestProfileOff.class)
1717
@DisabledOnOs(OS.WINDOWS)
18-
public class LgtmLifecycleTest extends LgtmTestBase {
18+
public class LgtmLifecycleTest extends LgtmConfigTestBase {
1919

2020
public static class TestResourceTestProfileOff implements QuarkusTestProfile {
2121
@Override
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
package io.quarkus.observability.test;
22

3+
import org.eclipse.microprofile.config.ConfigProvider;
34
import org.junit.jupiter.api.condition.DisabledOnOs;
45
import org.junit.jupiter.api.condition.OS;
56

67
import io.quarkus.test.junit.QuarkusIntegrationTest;
8+
import io.quarkus.test.junit.TestProfile;
79

810
@QuarkusIntegrationTest
11+
@TestProfile(LgtmResourcesTest.DevResourcesTestProfileOnly.class)
912
@DisabledOnOs(OS.WINDOWS)
10-
public class LgtmResourcesIT extends LgtmResourcesTest {
13+
public class LgtmResourcesIT extends LgtmTestBase {
14+
@Override
15+
protected String grafanaEndpoint() {
16+
return ConfigProvider.getConfig().getValue("grafana.endpoint", String.class);
17+
}
1118
}

integration-tests/observability-lgtm/src/test/java/io/quarkus/observability/test/LgtmResourcesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
@QuarkusTest
1616
@TestProfile(LgtmResourcesTest.DevResourcesTestProfileOnly.class)
1717
@DisabledOnOs(OS.WINDOWS)
18-
public class LgtmResourcesTest extends LgtmTestBase {
18+
public class LgtmResourcesTest extends LgtmConfigTestBase {
1919

2020
public static class DevResourcesTestProfileOnly implements QuarkusTestProfile {
2121
@Override

integration-tests/observability-lgtm/src/test/java/io/quarkus/observability/test/LgtmServicesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77

88
@QuarkusTest
99
@DisabledOnOs(OS.WINDOWS)
10-
public class LgtmServicesTest extends LgtmTestBase {
10+
public class LgtmServicesTest extends LgtmConfigTestBase {
1111
}

integration-tests/observability-lgtm/src/test/java/io/quarkus/observability/test/LgtmTestBase.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import java.util.concurrent.TimeUnit;
44

55
import org.awaitility.Awaitility;
6-
import org.eclipse.microprofile.config.inject.ConfigProperty;
76
import org.jboss.logging.Logger;
87
import org.junit.jupiter.api.Test;
98

@@ -13,15 +12,14 @@
1312
public abstract class LgtmTestBase {
1413
private final Logger log = Logger.getLogger(getClass());
1514

16-
@ConfigProperty(name = "grafana.endpoint")
17-
String endpoint;
15+
protected abstract String grafanaEndpoint();
1816

1917
@Test
2018
public void testTracing() {
2119
log.info("Testing Grafana ...");
2220
String response = RestAssured.get("/api/poke?f=100").body().asString();
2321
log.info("Response: " + response);
24-
GrafanaClient client = new GrafanaClient(endpoint, "admin", "admin");
22+
GrafanaClient client = new GrafanaClient(grafanaEndpoint(), "admin", "admin");
2523
Awaitility.await().atMost(61, TimeUnit.SECONDS).until(
2624
client::user,
2725
u -> "admin".equals(u.login));

0 commit comments

Comments
 (0)