Skip to content
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' @Container annotation #71

Merged

Conversation

rursprung
Copy link
Collaborator

so far we started the testcontainer manually. however, the official way is to use the @Testcontainers and @Container annotations.

the major difference in behaviour between the two is that in our existing setup we started one container for all tests together, so they could influence each other, while the new setup launches a new container for each test. the downside of this is that test execution now takes longer as it always needs to spin up a new container and wait for OpenSearch to start. as we don't have that many tests this should be acceptable and the improved stability is probably worth it.

so far we started the testcontainer manually. however, [the official
way][quickstart] is to use the `@Testcontainers` and `@Container`
annotations.

the major difference in behaviour between the two is that in our
existing setup we started one container for all tests together, so they
could influence each other, while the new setup launches a new container
for each test. the downside of this is that test execution now takes
longer as it always needs to spin up a new container and wait for
OpenSearch to start. as we don't have that many tests this should be
acceptable and the improved stability is probably worth it.

[quickstart]: https://java.testcontainers.org/quickstart/junit_5_quickstart/
Copy link

sonarcloud bot commented Nov 14, 2024

@rursprung rursprung merged commit 11b4c44 into liquibase:master Nov 19, 2024
10 of 12 checks passed
@rursprung rursprung deleted the use-testcontainers-annotations branch November 19, 2024 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants