Skip to content

Commit

Permalink
Merge branch '1.13.x' into 1.14.x
Browse files Browse the repository at this point in the history
  • Loading branch information
shakuzen committed Nov 15, 2024
2 parents 0867c60 + bd90d13 commit 1969651
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ maven-resolver = "1.9.22"
mockito4 = "4.11.0"
mockito5 = "5.11.0"
mongo = "4.11.4"
netty = "4.1.114.Final"
netty = "4.1.115.Final"
newrelic-api = "5.14.0"
# Kotlin 1.7 sample will fail from OkHttp 4.12.0 due to okio dependency being a Kotlin 1.9 module
okhttp = "4.11.0"
Expand Down
4 changes: 4 additions & 0 deletions implementations/micrometer-registry-prometheus/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ dependencies {
testImplementation 'org.testcontainers:junit-jupiter'
testImplementation 'org.awaitility:awaitility'
}

dockerTest {
systemProperty 'prometheus.version', 'v2.55.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
class PrometheusMeterRegistryIntegrationTest {

@Container
static GenericContainer<?> prometheus = new GenericContainer<>(DockerImageName.parse("prom/prometheus:latest"))
static GenericContainer<?> prometheus = new GenericContainer<>(
DockerImageName.parse("prom/prometheus:" + getPrometheusImageVersion()))
.withCommand("--config.file=/etc/prometheus/prometheus.yml")
.withClasspathResourceMapping("prometheus.yml", "/etc/prometheus/prometheus.yml", READ_ONLY)
.waitingFor(Wait.forLogMessage(".*Server is ready to receive web requests.*", 1))
Expand All @@ -72,6 +73,15 @@ class PrometheusMeterRegistryIntegrationTest {
@Nullable
private HttpServer prometheusTextServer;

private static String getPrometheusImageVersion() {
String version = System.getProperty("prometheus.version");
if (version == null) {
throw new IllegalStateException(
"System property 'prometheus.version' is not set. This should be set in the build configuration for running from the command line. If you are running PrometheusMeterRegistryIntegrationTest from an IDE, set the system property to the desired prom/prometheus image version.");
}
return version;
}

@BeforeEach
void setUp() {
org.testcontainers.Testcontainers.exposeHostPorts(12345, 12346);
Expand Down

0 comments on commit 1969651

Please sign in to comment.