Skip to content

Commit

Permalink
fixup! feat(e2e): add e2e tests
Browse files Browse the repository at this point in the history
Use testcontainer logging consumer instead
  • Loading branch information
jeqo committed Aug 29, 2023
1 parent d7daa4a commit d0eaa36
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
import org.slf4j.LoggerFactory;
import org.testcontainers.containers.KafkaContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.utility.DockerImageName;

Expand Down Expand Up @@ -162,6 +163,7 @@ static void setupKafka(final Consumer<KafkaContainer> tsPluginSetup) throws Exce
.withCreateContainerCmdModifier(
cmd -> cmd.getHostConfig().withUlimits(List.of(new Ulimit("nofile", 30_000L, 30_000L))))
.withFileSystemBind(localDataDir.toString(), KAFKA_DATA_DIR_CONTAINER)
.withLogConsumer(new Slf4jLogConsumer(LoggerFactory.getLogger("kafka")))
.withNetwork(NETWORK);

tsPluginSetup.accept(kafka);
Expand All @@ -182,11 +184,6 @@ static void stopKafka() {
adminClient.close();
}

if (FailFastExtension.failed) {
LOG.info("Kafka container logs:");
LOG.info(kafka.getLogs());
}

kafka.stop();
}

Expand Down

0 comments on commit d0eaa36

Please sign in to comment.