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

remove remaining Docker containers when tests are interrupted #88

Merged
merged 2 commits into from
Mar 29, 2021
Merged

remove remaining Docker containers when tests are interrupted #88

merged 2 commits into from
Mar 29, 2021

Conversation

d9pouces
Copy link
Contributor

@d9pouces d9pouces commented Mar 7, 2021

Remove remaining Docker containers when tests are interrupted.

Avoid the use of a global variable, but assume that Docker calls are all working without exception.

Does not work with tox < 3 (the required tox_cleanup hook is missing).

d9pouces and others added 2 commits March 7, 2021 22:46
…ng the use of a global variable.

does not work with tox < 3 (the `tox_cleanup` hook is missing).
@hans2520
Copy link

hans2520 commented Mar 23, 2021

@d9pouces is this going to be merged?

Looking to upgrade to tox-docker v2 (which seems to be needed to use the latest MySQL versions such as v8 or 5.7.31), but the change in section naming is problematic without automatic cleanup.

In previous versions of tox-docker, a container name wasn't specified, and so a auto-generated name by docker was created. This would leave a container behind, but it wouldn't prevent a new test run from starting since it would use a new auto-generated name.

Now that the section name also serves as the container name -- if that container isn't cleaned up afterwards, the same container name will be used on subsequent runs, and it will fail to start if there is a docker conflict.

The CLI argument to prevent cleanup of containers on exit should also probably be added as an explicit option in the ini file as well.

@d9pouces
Copy link
Contributor Author

from my point of view, everything is ok for merging it

@dcrosta dcrosta merged commit 00c8187 into tox-dev:master Mar 29, 2021
@dcrosta
Copy link
Member

dcrosta commented Mar 29, 2021

Thanks! Just posted https://pypi.org/project/tox-docker/3.0.0/ with this fix; I decided to remove tox 2.x support, which is > 3 years old at this point.

@dcrosta
Copy link
Member

dcrosta commented Mar 29, 2021

Does this address the issue in #37, specifically the case where an exception is raised from within tox-docker's tox_runtest_pre function? (I can test this later, just curious if you happened to do so while working on this, @d9pouces)

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.

3 participants