Skip to content

Handle compose down with container_name case#39

Closed
rtoohil wants to merge 1 commit intoMcrich23:mainfrom
rtoohil:feature/compose-down-not-stopping-containers
Closed

Handle compose down with container_name case#39
rtoohil wants to merge 1 commit intoMcrich23:mainfrom
rtoohil:feature/compose-down-not-stopping-containers

Conversation

@rtoohil
Copy link
Contributor

@rtoohil rtoohil commented Dec 1, 2025

If you use container_name: with a custom name in your compose file, compose up properly handles that, but compose down does not, and defaults to its internal naming, will fail to stop the container, and will not throw an error, because it eats the error.

See #38

This should resolve that case. PR contributed to with Claude.

@Mcrich23 Mcrich23 self-assigned this Dec 3, 2025
Copy link
Owner

@Mcrich23 Mcrich23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Thank you

Would it be possible to add a new dynamic test for this? You can just make a new file in Tests/Container-Compose-DynamicTests called ComposeDownTests.swift. It could probably just bring up a container and then shut it down and make sure that everything goes up and down.

oxisto added a commit to oxisto/Container-Compose that referenced this pull request Jan 30, 2026
This provies the missing tests for PR Mcrich23#39
oxisto added a commit to oxisto/Container-Compose that referenced this pull request Jan 30, 2026
This provies the missing tests for PR Mcrich23#39
@oxisto
Copy link
Contributor

oxisto commented Jan 30, 2026

This looks great! Thank you

Would it be possible to add a new dynamic test for this? You can just make a new file in Tests/Container-Compose-DynamicTests called ComposeDownTests.swift. It could probably just bring up a container and then shut it down and make sure that everything goes up and down.

I took the liberty of adding said test in #50, also with a little bit of a test hardness to quickly copy the YAML stuff in the correct folder.

@rtoohil
Copy link
Contributor Author

rtoohil commented Jan 31, 2026

Thanks! I've been hit with the real life bug and haven't had time to get back to these PRs, but I appreciate the help of adding the test!

Mcrich23 added a commit that referenced this pull request Feb 4, 2026
* Handle compose down with container_name case

* Providing tests for `container-compose down`

This provies the missing tests for PR #39

* Correctly asserting up/down

* Added copyYamlToTemporaryLocation as test helper

* Addressing code review

* test expect cleanup for containers running and stopping

* Update ComposeDownTests.swift

* Update ComposeDownTests.swift

* Update ComposeDownTests.swift

---------

Co-authored-by: rtoohil <ryan@ryantoohil.com>
Co-authored-by: Morris Richman <81453549+Mcrich23@users.noreply.github.com>
@Mcrich23 Mcrich23 closed this Feb 6, 2026
@Mcrich23
Copy link
Owner

Mcrich23 commented Feb 6, 2026

Merged this with #50.

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

Successfully merging this pull request may close these issues.

4 participants