Uh oh!
There was an error while loading. Please reload this page.
feat(core): DockerCompose.stop now stops only services that it starts (does not stop the other services) - #620
Conversation
…esent. The command would otherwise stop/down all services, not just the services the instance itself started. Useful for e.g. one fixture per service, and you want different scopes for the services.
aksel
commented
Jun 27, 2024
Apologies if my PR breaks any conventions or contribution guidelines. I was a bit confused by the docs, as they seemed to be targeted towards contributing features, which I don't think this is. Let me know if I should close, resubmit, or change anything Thanks! 😄 |
My specific use case is this: importpytestfromtestcontainers.composeimportDockerCompose@pytest.fixture(scope="session")asyncdefaws() ->DockerCompose:
withDockerCompose(
".",
compose_file_name="docker-compose.yaml",
pull=True,
build=True,
services=["aws"],
# Wait for localstack to be healthywait=True,
) ascompose:
yieldcompose@pytest.fixture(scope="module")asyncdefdb(aws) ->DockerCompose:
withDockerCompose(
".",
compose_file_name="docker-compose.yaml",
pull=True,
build=True,
# Only start the DBservices=["db"],
# Wait for the DB to be healthywait=True,
) ascompose:
yieldcomposeStarting up |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## main #620 +/- ##
=======================================
Coverage ? 80.29% =======================================
Files ? 11 Lines ? 604 Branches ? 86 =======================================
Hits ? 485 Misses ? 92 Partials ? 27 ☔ View full report in Codecov by Sentry. |
🤖 I have created a release *beep* *boop* --- ## [4.7.0](testcontainers-v4.6.0...testcontainers-v4.7.0) (2024-06-28) ### Features * **core:** Added Generic module ([#612](#612)) ([e575b28](e575b28)) * **core:** allow custom dockerfile path for image build and bypassing build cache ([#615](#615)) ([ead0f79](ead0f79)), closes [#610](#610) * **core:** DockerCompose.stop now stops only services that it starts (does not stop the other services) ([#620](#620)) ([e711800](e711800)) ### Bug Fixes * **ollama:** Add support for ollama module ([#618](#618)) ([5442d05](5442d05)) * **cosmosdb:** Add support for the CosmosDB Emulator ([#579](#579)) ([8045a80](8045a80)) * improve ollama docs, s/ollama_dir/ollama_home/g ([#619](#619)) ([27f2a6b](27f2a6b)) * **kafka:** Add Kraft to Kafka containers ([#611](#611)) ([762d2a2](762d2a2)) ### Documentation * **contributing:** add contribution and new-container guide ([#460](#460)) ([3519f4b](3519f4b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
The command would otherwise stop/down all services, not just the services the instance itself started.
Useful for e.g. one fixture per service, and you want different scopes for the services.