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

Add example for --docker-dont-stop #174

Open
thenewguy opened this issue Dec 10, 2023 · 5 comments
Open

Add example for --docker-dont-stop #174

thenewguy opened this issue Dec 10, 2023 · 5 comments

Comments

@thenewguy
Copy link
Contributor

It isn't clear how to use --docker-dont-stop. I've added --docker-dont-stop=postgres to my tox command but get

python -m tox --docker-dont-stop=postgres -e interactive
usage: tox [-h] [--colored {yes,no}] [-v | -q] [--exit-and-dump-after seconds] [-c file] [--workdir dir] [--root dir] [--runner {virtualenv}] [--version] [--no-provision [REQ_JSON]] [--no-recreate-provision] [-r] [-x OVERRIDE]
           {run,r,run-parallel,p,depends,de,list,l,devenv,d,config,c,quickstart,q,exec,e,legacy,le} ...
tox: error: unrecognized arguments: --docker-dont-stop=postgres
hint: if you tried to pass arguments to a command use -- to separate them from tox ones
@dcrosta
Copy link
Member

dcrosta commented Dec 12, 2023

This sounds like you may not have tox-docker installed? The command line argument should be recognized as long as you're running a tox that has tox-docker...

@thenewguy
Copy link
Contributor Author

tox-docker is definitely installed because it is running a postgres and redis container for the application.

@dcrosta
Copy link
Member

dcrosta commented Dec 12, 2023

What version of tox and tox-docker do you have?

@thenewguy
Copy link
Contributor Author

Odd - I guess you are right. pip freeze shows tox==4.11.4 but does not display tox-docker. The tox.ini lists requires = tox-docker and then tox installs it automatically.

tox -e interactive runs the containers and makes them available to the application with the expected environment variables.

@dcrosta
Copy link
Member

dcrosta commented Dec 12, 2023

Interesting. I think that shouldnt work, requires installs things into the virtualenv the tests run in, not the env tox itself runs in. You should install tox-docker in the same way & place as you install tox itself, but I’m curious to figure out what’s managing the containers

Oh, I see, this is a new requires… I’m not sure if this should work or not. It may be an issue with tox itself. Let me get back to you here …

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