From 4607767b33dfccf9359daea641e9b090111dbe14 Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Thu, 20 Aug 2026 17:57:21 +0200 Subject: [PATCH 1/2] build: declare missing reactor dependencies Several `integration-tests` modules consume the output of other reactor modules without declaring a dependency on them. Maven derives the reactor build order solely from directly declared dependencies, so it does not know that those modules must be built first; serial builds happen to work only because of the module ordering. As a result `mvn -T1C package` races, and `mvn -pl -am` leaves the producing modules out of the reactor altogether. `it-spring-boot-smoke-test` receives `prometheus-metrics-core` only transitively, through `micrometer-registry-prometheus`, so neither `mvn -T1C package` nor `mvn -pl integration-tests/it-spring-boot-smoke-test -am` resolves the snapshot. The dependency is declared with the exclusion that `micrometer-registry-prometheus` applies, leaving the resolved set of artifacts, their versions and their scopes unchanged. `it-exporter-test` and `it-no-protobuf-test` run their sample applications from the shaded jars that the `it-exporter-*-sample` and `it-exporter-no-protobuf` modules leave in `target`, a dependency that `ExporterTest` expresses only as a relative filesystem path. The sample modules are therefore declared as test dependencies. Signed-off-by: Stephan Schroevers --- .../it-exporter/it-exporter-test/pom.xml | 31 +++++++++++++++++++ .../it-exporter/it-no-protobuf-test/pom.xml | 13 ++++++++ .../it-spring-boot-smoke-test/pom.xml | 16 ++++++++++ 3 files changed, 60 insertions(+) diff --git a/integration-tests/it-exporter/it-exporter-test/pom.xml b/integration-tests/it-exporter/it-exporter-test/pom.xml index 40ee58412..9620db370 100644 --- a/integration-tests/it-exporter/it-exporter-test/pom.xml +++ b/integration-tests/it-exporter/it-exporter-test/pom.xml @@ -29,5 +29,36 @@ ${guava.version} test + + + io.prometheus + it-exporter-servlet-tomcat-sample + ${project.version} + test + + + io.prometheus + it-exporter-servlet-jetty-sample + ${project.version} + test + + + io.prometheus + it-exporter-httpserver-sample + ${project.version} + test + + + io.prometheus + it-exporter-duplicate-metrics-sample + ${project.version} + test + diff --git a/integration-tests/it-exporter/it-no-protobuf-test/pom.xml b/integration-tests/it-exporter/it-no-protobuf-test/pom.xml index 389867de5..313cefe7b 100644 --- a/integration-tests/it-exporter/it-no-protobuf-test/pom.xml +++ b/integration-tests/it-exporter/it-no-protobuf-test/pom.xml @@ -23,5 +23,18 @@ ${project.version} test + + + io.prometheus + it-exporter-no-protobuf + ${project.version} + test + diff --git a/integration-tests/it-spring-boot-smoke-test/pom.xml b/integration-tests/it-spring-boot-smoke-test/pom.xml index 6c0f92357..11afc50b6 100644 --- a/integration-tests/it-spring-boot-smoke-test/pom.xml +++ b/integration-tests/it-spring-boot-smoke-test/pom.xml @@ -56,6 +56,22 @@ micrometer-registry-prometheus runtime + + + io.prometheus + prometheus-metrics-core + runtime + + + io.prometheus + prometheus-metrics-tracer-initializer + + + org.springframework.boot spring-boot-starter-test From 16b24e918797530cfe93afd0ef80f13df0a55ba2 Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Thu, 20 Aug 2026 17:57:21 +0200 Subject: [PATCH 2/2] test: bind `ExemplarTest`'s WireMock server to a dynamic port Port 4317 is the default OTLP port, so this test fails on any machine that runs a collector. It also collides with itself: `prometheus-metrics-exporter-opentelemetry-shaded` compiles and runs this module's test sources, so the test executes twice per build, concurrently under `mvn -T`. Signed-off-by: Stephan Schroevers --- .../metrics/exporter/opentelemetry/ExemplarTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/prometheus-metrics-exporter-opentelemetry/src/test/java/io/prometheus/metrics/exporter/opentelemetry/ExemplarTest.java b/prometheus-metrics-exporter-opentelemetry/src/test/java/io/prometheus/metrics/exporter/opentelemetry/ExemplarTest.java index c21f1ead4..c764f3e83 100644 --- a/prometheus-metrics-exporter-opentelemetry/src/test/java/io/prometheus/metrics/exporter/opentelemetry/ExemplarTest.java +++ b/prometheus-metrics-exporter-opentelemetry/src/test/java/io/prometheus/metrics/exporter/opentelemetry/ExemplarTest.java @@ -13,6 +13,7 @@ import static org.awaitility.Awaitility.await; import com.github.tomakehurst.wiremock.http.Request; +import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo; import com.github.tomakehurst.wiremock.junit5.WireMockTest; import com.github.tomakehurst.wiremock.matching.MatchResult; import com.github.tomakehurst.wiremock.matching.ValueMatcher; @@ -34,7 +35,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -@WireMockTest(httpPort = 4317) +@WireMockTest class ExemplarTest { private static final String ENDPOINT_PATH = "/v1/metrics"; private static final int TIMEOUT = 3; @@ -45,10 +46,10 @@ class ExemplarTest { private OpenTelemetryExporter openTelemetryExporter; @BeforeEach - void setUp() { + void setUp(WireMockRuntimeInfo wireMockRuntimeInfo) { openTelemetryExporter = OpenTelemetryExporter.builder() - .endpoint("http://localhost:4317") + .endpoint(wireMockRuntimeInfo.getHttpBaseUrl()) .protocol("http/protobuf") .intervalSeconds(1) .buildAndStart();