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

Reuse of testcontaines requires additional setup. #13

Closed
vrogach2020 opened this issue Mar 22, 2021 · 5 comments
Closed

Reuse of testcontaines requires additional setup. #13

vrogach2020 opened this issue Mar 22, 2021 · 5 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@vrogach2020
Copy link
Contributor

On windows environment you need to add the following .testcontainers.properties file in your home directory to get 'withReuse' option working:

testcontainers.reuse.enable=true

See https://stackoverflow.com/questions/62425598/how-to-reuse-testcontainers-between-multiple-springboottests

@vrogach2020 vrogach2020 added the documentation Improvements or additions to documentation label Mar 22, 2021
@andrei-punko
Copy link

It's looks strange - requirement to add some property on Windows only to have same behavior on all platforms.
Library should have same behavior for same set of properties on all platforms.

@akudiyar
Copy link
Collaborator

Related issue: testcontainers/testcontainers-java#1781

@vrogach2020
Copy link
Contributor Author

@andrei-punko you are right. It seems that behavior should be similar for all environments: reuse option is off by default. See
https://github.com/testcontainers/testcontainers-java/blob/master/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java#L167

I've tested the library on Ubuntu and Windows envs and observe that TC reuse is not working on my Ubuntu 20 with latest docker versions. Looks like 'reuse' is not a stable feature but I think we should add some notes on this property.

@vrogach2020 vrogach2020 changed the title Reuse of testcontaines requires additional setup on some environments. Reuse of testcontaines requires additional setup. Mar 22, 2021
@bsideup
Copy link

bsideup commented Mar 23, 2021

withReuse says that the container is "reusable" (as in, can be used by multiple test sessions, not just tests in the same testing session)

testcontainers.reuse.enable=true is an OS-independent option to say "this environment supports the containers reuse"

@vrogach2020
Copy link
Contributor Author

We have nothing to do with our library here after @bsideup 's clarifing comment.
Closing issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants