Fix load command in pdb/no-discover path

This commit fixes a small oversight in the ostestr --pdb/--no-discover
path. When we go to load the results from the run the command used to
load the results was still using testrepository, which is not used
anywhere else in ostestr at this point.(and is not in requirements.txt
anymore) This commit fixes this and switches it to use stestr instead.
That also exposed another bug in that code path where it was assuming
a repository was created before ostestr was run which is fixed as part
of this commit.

Change-Id: Icb3492ab0f08248a33f711807b150b4a9748fda6
This commit is contained in:
Matthew Treinish 2018-01-16 11:03:06 -05:00
parent 206e3275c1
commit 2b3e2e88f7
No known key found for this signature in database
GPG Key ID: FD12A0F214C9E177
2 changed files with 5 additions and 3 deletions

View File

@ -184,7 +184,9 @@ def call_testr(regex, subunit, pretty, list_tests, slowest, parallel, concur,
def call_subunit_run(test_id, pretty, subunit):
env = copy.deepcopy(os.environ)
cmd_save_results = ['testr', 'load', '--subunit']
cmd_save_results = ['stestr', 'load', '--subunit']
if not os.path.isdir('.stestr'):
commands.init_command()
if pretty:
# Use subunit run module

View File

@ -142,7 +142,7 @@ class TestCallers(base.TestCase):
msg = "Function %s not called"
function = ['python', '-m', 'subunit.run', 'project.tests.foo']
self.assertIn(function, called[0][0], msg % 'subunit.run')
function = ['testr', 'load', '--subunit']
function = ['stestr', 'load', '--subunit']
self.assertIn(function, called[1][0], msg % 'testr load')
function = ['subunit-trace', '--no-failure-debug', '-f']
self.assertIn(function, called[2][0], msg % 'subunit-trace')
@ -166,7 +166,7 @@ class TestCallers(base.TestCase):
# Validate Popen called the right function
called = mock_popen.call_args
function = ['testr', 'load', '--subunit']
function = ['stestr', 'load', '--subunit']
self.assertIn(function, called[0], "testr load not called")
def test_call_subunit_run_testtools(self):