ostestr --pdb is not working without running 'testr init' first

Bug #1721510 reported by Pavlo Shchelokovskyy
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
os-testr
Invalid
Undecided
Unassigned

Bug Description

using os-testr 1.0.0

Although os-testr has switched to 'stestr' as underlying test runner, it still calls out to the
'testr load --subunit' command when being run with '--pdb' or '--no-pretty --subunit' [0]

On a freshly checked out code that is already using os-testr 1.0.0 there is no '.testrepository' folder created, so such command fail with

'No repository found in <repo-path>. Create one by running "testr init".'

running 'testr init' manually solves this.

[0] http://git.openstack.org/cgit/openstack/os-testr/tree/os_testr/ostestr.py#n177

Reproduce:

$ cd /tmp && git clone git://git.openstack.org/openstack/os-testr && cd os-testr
$ tox -epy27 -- --pdb os_testr.tests.test_ostestr.TestCallers.test_call_subunit_run_sub
py27 create: /tmp/os-testr/.tox/py27
py27 installdeps: -r/tmp/os-testr/requirements.txt, -r/tmp/os-testr/test-requirements.txt
py27 develop-inst: /tmp/os-testr
py27 installed: alabaster==0.7.10,appdirs==1.4.3,Babel==2.5.1,certifi==2017.7.27.1,chardet==3.0.4,coverage==4.4.1,ddt==1.1.1,debtcollector==1.18.0,docutils==0.14,dulwich==0.18.3,extras==1.0.0,fixtures==3.0.0,flake8==2.5.5,funcsigs==1.0.2,future==0.16.0,hacking==0.12.0,idna==2.6,imagesize==0.7.1,iso8601==0.1.11,Jinja2==2.9.6,keystoneauth1==3.2.0,linecache2==1.0.0,MarkupSafe==1.0,mccabe==0.2.1,mock==2.0.0,mox3==0.23.0,openstack-requirements==1.1.0,openstackdocstheme==1.17.0,os-client-config==1.28.0,-e git://git.openstack.org/openstack/os-testr@7dd678e3720c326afb3ca7adfd01ec7324d5f5c7#egg=os_testr,oslotest==2.18.1,packaging==16.8,Parsley==1.3,pbr==3.1.1,pep8==1.5.7,pyflakes==0.8.1,Pygments==2.2.0,pyparsing==2.2.0,python-mimeparse==1.6.0,python-subunit==1.2.0,pytz==2017.2,PyYAML==3.12,requests==2.18.4,requestsexceptions==1.3.0,six==1.11.0,snowballstemmer==1.2.1,Sphinx==1.6.4,sphinxcontrib-websupport==1.0.1,stestr==1.0.0,stevedore==1.27.0,testrepository==0.0.20,testscenarios==0.5.0,testtools==2.3.0,traceback2==1.4.0,typing==3.6.2,unittest2==1.1.0,urllib3==1.22,wrapt==1.10.11
py27 runtests: PYTHONHASHSEED='1977009296'
py27 runtests: commands[0] | find . -type f -name *.pyc -delete
py27 runtests: commands[1] | ostestr --pdb os_testr.tests.test_ostestr.TestCallers.test_call_subunit_run_sub
No repository found in /tmp/os-testr. Create one by running "testr init".
The test run didn't actually run any tests
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/tmp/os-testr/.tox/py27/lib/python2.7/site-packages/subunit/run.py", line 149, in <module>
    main()
  File "/tmp/os-testr/.tox/py27/lib/python2.7/site-packages/subunit/run.py", line 145, in main
    stdout=stdout, exit=False)
  File "/tmp/os-testr/.tox/py27/local/lib/python2.7/site-packages/testtools/run.py", line 187, in __init__
    self.runTests()
  File "/tmp/os-testr/.tox/py27/local/lib/python2.7/site-packages/testtools/run.py", line 221, in runTests
    self.result = testRunner.run(self.test)
  File "/tmp/os-testr/.tox/py27/lib/python2.7/site-packages/subunit/run.py", line 62, in run
    result, _ = self._list(test)
  File "/tmp/os-testr/.tox/py27/lib/python2.7/site-packages/subunit/run.py", line 100, in _list
    result.status(test_id=test_id, test_status='exists')
  File "/tmp/os-testr/.tox/py27/local/lib/python2.7/site-packages/subunit/v2.py", line 120, in status
    route_code=route_code, timestamp=timestamp)
  File "/tmp/os-testr/.tox/py27/local/lib/python2.7/site-packages/subunit/v2.py", line 228, in _write_packet
    self.output_stream.write(data)
IOError: [Errno 32] Broken pipe
ERROR: InvocationError: '/tmp/os-testr/.tox/py27/bin/ostestr --pdb os_testr.tests.test_ostestr.TestCallers.test_call_subunit_run_sub'
___________________________________________________________________________________ summary ____________________________________________________________________________________
ERROR: py27: commands failed

Changed in os-testr:
assignee: nobody → Pavlo Shchelokovskyy (pshchelo)
Changed in os-testr:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on os-testr (master)

Change abandoned by Pavlo Shchelokovskyy (<email address hidden>) on branch: master
Review: https://review.openstack.org/509752
Reason: ostestr is deprecated in favor of stestr

Changed in os-testr:
status: In Progress → Invalid
assignee: Pavlo Shchelokovskyy (pshchelo) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.