While I grumbled when run_tests.sh was deprecated with just a terse message to go read the docs about tox, I have since switched over. Here is my quick tox transition tutorial.
To list the target environments:
Currently this is:
py26 py27 py33 pep8 docs sample_config
To run anyone of these, you pass it to tox via the -e option:
To build just the docs
Pep 8 check
Run Unit tests for python2.7
tox -e cover
Update config file
Run any of them with the -r flag to recreate the tox repo, but it takes a long time.
Each of the environments listed corresponds to a virtual environment under .tox. If you want to, say, run the keystone server that you have built, from the top directory in your keystone git sandbox:
. .tox/py27/bin/activate .tox/py27/bin/keystone-all
Note that the same thing will work for a custom keystone client:
cd /opt/stack/python-keystonclient . .tox/py27/bin/activate . ~/keystonerc #pronounced keystoner-see .tox/py27/bin/bin/keystone token-get
If the python33 run fails with the error
‘db type could not be determined’
you should remove the file
To just build the virtual environment for development without running the tests:
tox -epy27 --notest -r
If you have more, let me know and I’ll update the post.