Skip to content

Reuse of testcontaines requires additional setup.  #13

Closed

Description

@vrogach2020

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

Activity

  1. andrei-punko commented on Mar 22, 2021

    @andrei-punko

    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.

  2. akudiyar commented on Mar 22, 2021

    @akudiyar
    Collaborator
  3. vrogach2020 commented on Mar 22, 2021

    @vrogach2020
    ContributorAuthor

    @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.

  4. changed the title [-]Reuse of testcontaines requires additional setup on some environments. [/-] [+]Reuse of testcontaines requires additional setup. [/+] on Mar 22, 2021
  5. bsideup commented on Mar 23, 2021

    @bsideup

    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"

  6. vrogach2020 commented on Nov 11, 2021

    @vrogach2020
    ContributorAuthor

    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

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions