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

Fix IT / native test(s), add it to native-tests run #44158

Merged
merged 1 commit into from
Nov 6, 2024
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
2 changes: 1 addition & 1 deletion .github/native-tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
{
"category": "Misc4",
"timeout": 130,
"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",
"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",
"os-name": "ubuntu-latest"
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.quarkus.observability.test;

import org.eclipse.microprofile.config.inject.ConfigProperty;

public abstract class LgtmConfigTestBase extends LgtmTestBase {

@ConfigProperty(name = "grafana.endpoint")
brunobat marked this conversation as resolved.
Show resolved Hide resolved
String endpoint;

@Override
protected String grafanaEndpoint() {
return endpoint;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@QuarkusTest
@TestProfile(LgtmGrpcTest.GrpcTestProfileOnly.class)
@DisabledOnOs(OS.WINDOWS)
public class LgtmGrpcTest extends LgtmTestBase {
public class LgtmGrpcTest extends LgtmConfigTestBase {

public static class GrpcTestProfileOnly implements QuarkusTestProfile {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@QuarkusTestResource(value = LgtmResource.class, restrictToAnnotatedClass = true)
@TestProfile(LgtmLifecycleTest.TestResourceTestProfileOff.class)
@DisabledOnOs(OS.WINDOWS)
public class LgtmLifecycleTest extends LgtmTestBase {
public class LgtmLifecycleTest extends LgtmConfigTestBase {

public static class TestResourceTestProfileOff implements QuarkusTestProfile {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
package io.quarkus.observability.test;

import org.eclipse.microprofile.config.ConfigProvider;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;

import io.quarkus.test.junit.QuarkusIntegrationTest;
import io.quarkus.test.junit.TestProfile;

@QuarkusIntegrationTest
@TestProfile(LgtmResourcesTest.DevResourcesTestProfileOnly.class)
@DisabledOnOs(OS.WINDOWS)
public class LgtmResourcesIT extends LgtmResourcesTest {
public class LgtmResourcesIT extends LgtmTestBase {
@Override
protected String grafanaEndpoint() {
return ConfigProvider.getConfig().getValue("grafana.endpoint", String.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@QuarkusTest
@TestProfile(LgtmResourcesTest.DevResourcesTestProfileOnly.class)
@DisabledOnOs(OS.WINDOWS)
public class LgtmResourcesTest extends LgtmTestBase {
public class LgtmResourcesTest extends LgtmConfigTestBase {

public static class DevResourcesTestProfileOnly implements QuarkusTestProfile {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@

@QuarkusTest
@DisabledOnOs(OS.WINDOWS)
public class LgtmServicesTest extends LgtmTestBase {
public class LgtmServicesTest extends LgtmConfigTestBase {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.util.concurrent.TimeUnit;

import org.awaitility.Awaitility;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.jboss.logging.Logger;
import org.junit.jupiter.api.Test;

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

@ConfigProperty(name = "grafana.endpoint")
String endpoint;
protected abstract String grafanaEndpoint();

@Test
public void testTracing() {
log.info("Testing Grafana ...");
String response = RestAssured.get("/api/poke?f=100").body().asString();
log.info("Response: " + response);
GrafanaClient client = new GrafanaClient(endpoint, "admin", "admin");
GrafanaClient client = new GrafanaClient(grafanaEndpoint(), "admin", "admin");
Awaitility.await().atMost(61, TimeUnit.SECONDS).until(
client::user,
u -> "admin".equals(u.login));
Expand Down
Loading