tox-dev / tox-docker

A tox plugin to run one or more Docker containers during tests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add example for `--docker-dont-stop`

thenewguy opened this issue · comments

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

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...

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

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

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.

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 …