-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16435 from cescoffier/attempt-to-fix-kafka-ci-issues
Attempt to fix the Kafka flaky tests
- Loading branch information
Showing
60 changed files
with
1,812 additions
and
701 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...ests/kafka-avro/src/test/java/io/quarkus/it/kafka/KafkaAndSchemaRegistryTestResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package io.quarkus.it.kafka; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import org.testcontainers.containers.GenericContainer; | ||
|
||
import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; | ||
import io.strimzi.StrimziKafkaContainer; | ||
|
||
public class KafkaAndSchemaRegistryTestResource implements QuarkusTestResourceLifecycleManager { | ||
|
||
private static final StrimziKafkaContainer kafka = new StrimziKafkaContainer(); | ||
|
||
private static GenericContainer<?> registry; | ||
|
||
public static String getBootstrapServers() { | ||
return kafka.getBootstrapServers(); | ||
} | ||
|
||
public static String getConfluentSchemaRegistryUrl() { | ||
return "http://" + registry.getContainerIpAddress() + ":" + registry.getMappedPort(8080) + "/api/ccompat"; | ||
} | ||
|
||
public static String getApicurioSchemaRegistryUrl() { | ||
return "http://" + registry.getContainerIpAddress() + ":" + registry.getMappedPort(8080) + "/api"; | ||
} | ||
|
||
@Override | ||
public Map<String, String> start() { | ||
kafka.start(); | ||
registry = new GenericContainer<>("apicurio/apicurio-registry-mem:1.2.2.Final") | ||
.withExposedPorts(8080) | ||
.withEnv("QUARKUS_PROFILE", "prod") | ||
.withEnv("KAFKA_BOOTSTRAP_SERVERS", kafka.getBootstrapServers()) | ||
.withEnv("APPLICATION_ID", "registry_id") | ||
.withEnv("APPLICATION_SERVER", "localhost:9000"); | ||
registry.start(); | ||
Map<String, String> properties = new HashMap<>(); | ||
properties.put("schema.url.confluent", | ||
"http://" + registry.getContainerIpAddress() + ":" + registry.getMappedPort(8080) + "/api/ccompat"); | ||
properties.put("schema.url.apicurio", | ||
"http://" + registry.getContainerIpAddress() + ":" + registry.getMappedPort(8080) + "/api"); | ||
properties.put("kafka.bootstrap.servers", kafka.getBootstrapServers()); | ||
return properties; | ||
} | ||
|
||
@Override | ||
public void stop() { | ||
registry.stop(); | ||
kafka.close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.