Skip to content

Instantly share code, notes, and snippets.

@4383
Created November 13, 2018 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 4383/7e7f28770a9c1fb4ede47926d5fda195 to your computer and use it in GitHub Desktop.
Save 4383/7e7f28770a9c1fb4ede47926d5fda195 to your computer and use it in GitHub Desktop.
mastering tox debuging
# assuming that I run the unit test of oslo.service
# https://github.com/openstack/oslo.service
# if you want to do the same things you need first to clone the oslo.service project
# to initialize tox environment you need to first tox basicaly
tox -e py35
# now your environment is setup you can run individual test by using testtools like this
.tox/py35/bin/python -m testtools.run oslo_service.tests.test_service.ServiceLauncherTest.test_child_signal_sighup
# this test is very long test and you can monitor resources usage by executing
# the following command.
# The following command track all process PID attached to this test execution
# and use htop (you can also use top) to display informations
htop $(ps ax | grep testtools | grep -v grep | awk '{ printf "-p %s ", $1 }')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment