Skip to content

kafka: don't require container for non-kafka tests#32364

Open
285729101 wants to merge 1 commit intojhipster:mainfrom
285729101:fix/kafka-container-tests
Open

kafka: don't require container for non-kafka tests#32364
285729101 wants to merge 1 commit intojhipster:mainfrom
285729101:fix/kafka-container-tests

Conversation

@285729101
Copy link

Summary

  • Removed @ImportTestcontainers(KafkaTestContainer.class) from IntegrationTest so the Kafka container no longer starts for every integration test
  • Moved spring.cloud.function.definition out of shared test application.yml and into KafkaResourceIT via @TestPropertySource, so the Kafka consumer/producer bindings only activate in tests that actually need them
  • Non-kafka tests (cucumber, entity ITs, etc.) no longer wait for a Kafka connection, cutting test time from ~10min back to ~2min

Closes #31133

Remove @ImportTestcontainers(KafkaTestContainer.class) from IntegrationTest
annotation so the Kafka container is no longer started for every integration
test. Move spring.cloud.function.definition to KafkaResourceIT via
@TestPropertySource so the Kafka consumer/producer bindings are only active
in tests that actually need them.

Closes jhipster#31133
@285729101
Copy link
Author

@mshima @DanielFran this removes the global Kafka testcontainer injection so non-Kafka test suites don't pay the startup cost. Would appreciate a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kafka container should not be required in some tests.

1 participant