-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use testcontainers for multi-broker integration tests and benchmarks #939
Use testcontainers for multi-broker integration tests and benchmarks #939
Conversation
testkit/src/main/java/akka/kafka/testkit/internal/KafkaContainer.java
Outdated
Show resolved
Hide resolved
f635b02
to
bf4a4fd
Compare
0e3294f
to
a83bd42
Compare
a9a0348
to
2a42967
Compare
2a42967
to
dd8908a
Compare
046191b
to
5548ab1
Compare
5548ab1
to
06f4c24
Compare
testkit/src/main/java/akka/kafka/testkit/internal/KafkaContainerCluster.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really powerful and much more structured than the former solution with lots of moving parts.
With this competent Testcontainers support, we should create a separate documentation page for it with a proper separation of Scala and Java.
An overview table of the possible testing variants seems necessary now.
testkit/src/main/java/akka/kafka/testkit/javadsl/TestcontainersKafkaTest.java
Show resolved
Hide resolved
testkit/src/main/scala/akka/kafka/testkit/KafkaTestkitTestcontainersSettings.scala
Outdated
Show resolved
Hide resolved
testkit/src/main/scala/akka/kafka/testkit/KafkaTestkitTestcontainersSettings.scala
Outdated
Show resolved
Hide resolved
Co-Authored-By: Enno <458526+ennru@users.noreply.github.com>
…ainersSettings.scala Co-Authored-By: Enno <458526+ennru@users.noreply.github.com>
6de8f4b
to
06be1b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work.
LGTM.
We can follow up with a PR to use Testcontainers for more of our tests so that they run on Scala 2.13 and move some long-running tests to the IntegrationTest
scope.
testkit/src/main/java/akka/kafka/testkit/javadsl/TestcontainersKafkaTest.java
Show resolved
Hide resolved
testkit/src/main/java/akka/kafka/testkit/javadsl/TestcontainersKafkaJunit4Test.java
Show resolved
Hide resolved
testkit/src/main/scala/akka/kafka/testkit/KafkaTestkitTestcontainersSettings.scala
Outdated
Show resolved
Hide resolved
testkit/src/main/scala/akka/kafka/testkit/internal/KafkaTestKit.scala
Outdated
Show resolved
Hide resolved
f4db0e8
to
a2be53e
Compare
Purpose
The
sbt-docker-compose
plugin is abandoned and difficult to manage. The only reason it was used was to support multi-broker Kafka clusters for integration testing. Now that we can setup equivalent clusters using testcontainers there's no need to include this plugin.References
Changes
takeWhile
to signal consumer stream shutdowns.KafkaContainer
. I created an upstream PR to add this support to testcontainer-java, but I've copied the implementations into our internal testkit DSL in the meantime.TestcontainersKafkaPerClassLike
to set testcontainer lifetime to test classsbt-docker-compose
andsbt-build-info
SBT pluginsKafkaTestkitTestcontainersSettings
TODO
Enable logs from running containers?Compare benchmark test results before and after this change (after merge)No strange difference visible.