Skip to content

Commit

Permalink
Address feedback from Maros
Browse files Browse the repository at this point in the history
Signed-off-by: Mickael Maison <[email protected]>
  • Loading branch information
mimaison committed Dec 2, 2024
1 parent ac7da0b commit 6762b00
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/test/java/io/strimzi/kafka/metrics/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@
public class TestUtils {

private static final String VERSION = "1.0.0-SNAPSHOT";
private static final String CLIENTS_IMAGE = "quay.io/strimzi-test-clients/test-clients:latest-kafka-3.9.0";
private static final String KAFKA_VERSION = "3.9.0";
private static final String CLIENTS_IMAGE = "quay.io/strimzi-test-clients/test-clients:latest-kafka-" + KAFKA_VERSION;
private static final Duration TIMEOUT = Duration.ofSeconds(10L);

public static final String REPORTER_JARS = "target/metrics-reporter-" + VERSION + "/metrics-reporter-" + VERSION + "/libs/";
public static final String MOUNT_PATH = "/opt/strimzi/metrics-reporter/";
public static final int PORT = Listener.parseListener(PrometheusMetricsReporterConfig.LISTENER_CONFIG_DEFAULT).port;
public static final String KAFKA_NETWORK_ALIAS = "kafka";

/**
* Query the HTTP endpoint and returns the output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ public class TestConsumerMetricsIT {
public void setUp() {
broker = new StrimziKafkaContainer()
.withKraft()
.withNetworkAliases("kafka");
.withNetworkAliases(TestUtils.KAFKA_NETWORK_ALIAS);
broker.start();

env = new HashMap<>();
env.put("CLIENT_TYPE", "KafkaConsumer");
env.put("BOOTSTRAP_SERVERS", "kafka:9091");
env.put("BOOTSTRAP_SERVERS", TestUtils.KAFKA_NETWORK_ALIAS + ":9091");
env.put("TOPIC", "my-topic");
env.put("GROUP_ID", "my-group");
env.put("ADDITIONAL_CONFIG", "metric.reporters=" + KafkaPrometheusMetricsReporter.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ public class TestProducerMetricsIT {
public void setUp() {
broker = new StrimziKafkaContainer()
.withKraft()
.withNetworkAliases("kafka");
.withNetworkAliases(TestUtils.KAFKA_NETWORK_ALIAS);
broker.start();

env = new HashMap<>();
env.put("CLIENT_TYPE", "KafkaProducer");
env.put("BOOTSTRAP_SERVERS", "kafka:9091");
env.put("BOOTSTRAP_SERVERS", TestUtils.KAFKA_NETWORK_ALIAS + ":9091");
env.put("TOPIC", "my-topic");
env.put("ADDITIONAL_CONFIG", "metric.reporters=" + KafkaPrometheusMetricsReporter.class.getName());
env.put("CLASSPATH", TestUtils.MOUNT_PATH + "*");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class TestStreamsMetricsIT {
public void setUp() throws Exception {
broker = new StrimziKafkaContainer()
.withKraft()
.withNetworkAliases("kafka");
.withNetworkAliases(TestUtils.KAFKA_NETWORK_ALIAS);
broker.start();

try (Admin admin = Admin.create(Map.of(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, broker.getBootstrapServers()))) {
Expand All @@ -59,7 +59,7 @@ public void setUp() throws Exception {

env = new HashMap<>();
env.put("CLIENT_TYPE", "KafkaStreams");
env.put("BOOTSTRAP_SERVERS", "kafka:9091");
env.put("BOOTSTRAP_SERVERS", TestUtils.KAFKA_NETWORK_ALIAS + ":9091");
env.put("APPLICATION_ID", "my-app-id");
env.put("SOURCE_TOPIC", "source-topic");
env.put("TARGET_TOPIC", "target-topic");
Expand Down

0 comments on commit 6762b00

Please sign in to comment.