I'm building a test suite for a project, and I would like to use the docker compose stack used for manual testing, this way I could start the compose stack manually, and it would be reused by the test suite.
But doing so makes ryuk down the compose stack when the test suite ends, which is not ideal for my use case.
I tried using TESTCONTAINERS_RYUK_DISABLED=true, but it is not perfect, because during the test execution, I still start some other containers, without using the compose stack, and I would like those to be picked up by ryuk.
I saw this line in the docker compose environment class.
public async up(services?: Array<string>): Promise<StartedDockerComposeEnvironment> {
log.info(`Starting DockerCompose environment "${this.projectName}"...`);
const client = await getContainerRuntimeClient();
const reaper = await getReaper(client);
reaper.addComposeProject(this.projectName);
I was wondering if the class could have a .withAutoTeardown(false), that would simply skip the compose project registration to ryuk.
This way, I could do something like :
const stack = await new DockerComposeEnvironment('.')
.withProjectName('my-project')
.withAutoTeardown(false)
.up()
And if stack.down is not explicitly called, then the stack would not be torn down.
(I accidently opened the issue with my other account)
I'm building a test suite for a project, and I would like to use the docker compose stack used for manual testing, this way I could start the compose stack manually, and it would be reused by the test suite.
But doing so makes ryuk down the compose stack when the test suite ends, which is not ideal for my use case.
I tried using TESTCONTAINERS_RYUK_DISABLED=true, but it is not perfect, because during the test execution, I still start some other containers, without using the compose stack, and I would like those to be picked up by ryuk.
I saw this line in the docker compose environment class.
I was wondering if the class could have a .withAutoTeardown(false), that would simply skip the compose project registration to ryuk.
This way, I could do something like :
And if stack.down is not explicitly called, then the stack would not be torn down.
(I accidently opened the issue with my other account)