Fix bugs in debugging with Tox

Fix PDB-based test debugging using Tox `debug` environment, ie `tox -e
debug <test>`.

* Tell `oslo_test_helper` what directory holds test.
  * Fixes `ImportError: Start directory is not importable:
    './openstacksdk/tests'`
  * See https://docs.openstack.org/oslotest/rocky/user/features.html#update-tox-ini
* Effectively disable test timeouts when debugging by setting timeout
  to 1 year.
  * Fixes `fixtures._fixtures.timeout.TimeoutException` during PDB
    prompt.

Story: 2004225
Task: 27744
Change-Id: I40fea330e6b6dba78927de66bfe643b9c9a3e5e6
This commit is contained in:
Corey Wright 2018-10-31 11:33:25 -05:00
parent a8ac6cc219
commit a084fe78bc
1 changed files with 3 additions and 1 deletions

View File

@ -51,10 +51,12 @@ commands =
commands = {posargs}
[testenv:debug]
# allow 1 year, or 31536000 seconds, to debug a test before it times out
setenv = OS_TEST_TIMEOUT=31536000
whitelist_externals = find
commands =
find . -type f -name "*.pyc" -delete
oslo_debug_helper {posargs}
oslo_debug_helper -t openstack/tests {posargs}
[testenv:cover]
setenv =