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

Multiple Suites with Single Container #248

Open
AlexWeinstein92 opened this issue Apr 19, 2023 · 2 comments
Open

Multiple Suites with Single Container #248

AlexWeinstein92 opened this issue Apr 19, 2023 · 2 comments

Comments

@AlexWeinstein92
Copy link

AlexWeinstein92 commented Apr 19, 2023

Currently I have a batch of Suites that inherit from TestContainersForAll through a common custom trait. I want them all to use the same container but cannot seem to figure it out.

Currently my issue is that things compile fine but each Suite only takes in containerDef override as a parameter. This would seem to imply that they each spin up their own container, which is not what I want. Accordingly the containers have many errors like failed to close the response and Local Docker Compose exited abnormally with code 1 whilst running command: --compatibility up -d.

Wondering if there is something else I should use other than TestContainersForAll. I am using override def nestedSuites to run the suites and passing in my containerDef as a parameter to each to override the one spun up in my custom trait that uses TestContainersForAll.

@8bitreid
Copy link
Contributor

according to the docs

TestContainersForAll will start multiple containers before all tests and stop after all tests

I think you can look into this https://java.testcontainers.org/features/reuse/ but I'm not sure.

@AlexWeinstein92
Copy link
Author

AlexWeinstein92 commented Jun 22, 2023

I don't think the reuse option will work - in TestContainersForAll I am not actually able to provide a container, it uses the ContainerDef to spin up a container for each suite (as far as I can tell from my test behaviour).

I have also completely forgotten about this ticket because I have moved on to testing a local kubernetes-deployed instance of my project with gatling in place of integration tests. You can close this ticket if desired.

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

No branches or pull requests

2 participants