ostestr has no default input and causes tox to fail to work

Bug #1472395 reported by Walt Boring
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
os-testr
Confirmed
Undecided
Assaf Muller

Bug Description

prior to use usage of ostestr in tox.ini settings, running tox on a specific test used to work.

tox -epy27 cinder.tests.unit.test_volume.VolumeTestCase.test_create_delete_consistencygroup
py27 develop-inst-nodeps: /opt/stack/cinder
py27 installed: aioeventlet==0.4,alembic==0.7.6,amqp==1.4.6,anyjson==0.3.3,appdirs==1.4.0,Babel==1.3,cachetools==1.0.3,cffi==1.1.2,-e git+http://git.openstack.org/openstack/cinder.git@5464cdd836861b42c0bedc2771f2af227c81d8b4#egg=cinder-bug_1472344,cliff==1.13.0,cmd2==0.6.8,contextlib2==0.4.0,coverage==3.7.1,cryptography==0.9.2,ddt==1.0.0,debtcollector==0.5.0,decorator==3.4.2,discover==0.4.0,docutils==0.12,ecdsa==0.13,enum34==1.0.4,eventlet==0.17.4,extras==0.0.3,fasteners==0.12.0,fixtures==1.3.1,flake8==2.2.4,functools32==3.2.3.post1,futures==3.0.3,greenlet==0.4.7,hacking==0.10.2,httplib2==0.9.1,idna==2.0,ipaddress==1.0.7,iso8601==0.1.10,Jinja2==2.7.3,jsonpatch==1.11,jsonpointer==1.9,jsonschema==2.5.1,keystonemiddleware==2.1.0,kombu==3.0.26,linecache2==1.0.0,lxml==3.4.4,Mako==1.0.1,MarkupSafe==0.23,mccabe==0.2.1,mock==1.0.1,monotonic==0.2,mox3==0.8.0,msgpack-python==0.4.6,netaddr==0.7.15,netifaces==0.10.4,networkx==1.9.1,os-brick==0.2.0,os-client-config==1.4.0,os-testr==0.2.0,oslo.concurrency==2.2.0,oslo.config==1.14.0,oslo.context==0.4.0,oslo.db==2.1.0,oslo.i18n==2.1.0,oslo.log==1.6.0,oslo.messaging==1.16.0,oslo.middleware==2.3.0,oslo.policy==0.7.0,oslo.reports==0.2.0,oslo.rootwrap==2.1.0,oslo.serialization==1.7.0,oslo.service==0.3.0,oslo.utils==1.8.0,oslo.versionedobjects==0.5.2,oslo.vmware==1.16.0,oslosphinx==3.0.0,oslotest==1.8.0,osprofiler==0.3.0,paramiko==1.15.2,Paste==2.0.2,PasteDeploy==1.5.2,pbr==1.2.0,pep8==1.5.7,posix-ipc==1.0.0,prettytable==0.7.2,psutil==1.2.1,psycopg2==2.6.1,pyasn1==0.1.8,pycadf==1.0.0,pycparser==2.14,pycrypto==2.6.1,pyflakes==0.8.1,Pygments==2.0.2,PyMySQL==0.6.6,pyOpenSSL==0.15.1,pyparsing==2.0.3,python-barbicanclient==3.2.0,python-glanceclient==0.19.0,python-keystoneclient==1.6.0,python-mimeparse==0.1.4,python-novaclient==2.26.0,python-subunit==1.1.0,python-swiftclient==2.4.0,pytz==2015.4,PyYAML==3.11,repoze.lru==0.6,requests==2.7.0,retrying==1.3.3,Routes==1.13,rtslib-fb==2.1.57,simplejson==3.7.3,six==1.9.0,Sphinx==1.2.3,SQLAlchemy==1.0.6,sqlalchemy-migrate==0.9.6,sqlparse==0.1.15,stevedore==1.6.0,suds-jurko==0.6,taskflow==1.14.0,tempest-lib==0.6.1,Tempita==0.5.2,testrepository==0.0.20,testresources==0.2.7,testscenarios==0.5.0,testtools==1.8.0,traceback2==1.4.0,trollius==1.0.4,unittest2==1.1.0,urllib3==1.10.4,warlock==1.1.0,WebOb==1.4.1,wheel==0.24.0,wrapt==1.10.5
py27 runtests: PYTHONHASHSEED='0'
py27 runtests: commands[0] | ostestr cinder.tests.unit.test_volume.VolumeTestCase.test_create_delete_consistencygroup
usage: ostestr [-h] [--blacklist_file BLACKLIST_FILE] [--regex REGEX]
               [--pretty] [--no-pretty] [--subunit] [--list]
               [--no-discover TEST_ID] [--slowest] [--no-slowest]
               [--pdb TEST_ID] [--parallel] [--serial] [--concurrency WORKERS]
               [--until-failure] [--print-exclude]
ostestr: error: unrecognized arguments: cinder.tests.unit.test_volume.VolumeTestCase.test_create_delete_consistencygroup
ERROR: InvocationError: '/opt/stack/cinder/.tox/py27/bin/ostestr cinder.tests.unit.test_volume.VolumeTestCase.test_create_delete_consistencygroup'
________________________________________________________ summary ________________________________________________________
ERROR: py27: commands failed

The workaround is to use a very unfriendly version of the tox command line such as
tox -epy27 -- --regex cinder.tests.unit.test_volume.VolumeTestCase.test_create_delete_consistencygroup

Revision history for this message
Summer (chengkun) wrote :

when I run test with old way of tox, it failed I don't know why. so i ask Matthew to solve the problem. I think it needed to have a detailed document about tox Command ,or what you said add default input

Revision history for this message
Assaf Muller (amuller) wrote :

We switched to use ostestr in neutron via (from tox.ini):
ostestr --regex '{posargs}'

However this means I can't pass tox parameters like I could via testr (i.e. tox -e some_env -- --until-failure test_regex).

I second the request in this bug to change ostestr so that an argument without '--' will be treated as the regex.

For example:
ostestr path.to.test

Will be treated as:
ostestr --regex path.to.test

And:
ostestr --until-failure path.to.test

Will be treated as:
ostestr --until-failure --regex path.to.test

This will allow ostestr to be used as such in tox.ini:
ostestr '{posargs}'

Which means that we'll be able (Once again) to pass parameters to ostestr via a tox invocation.

Changed in os-testr:
status: New → Confirmed
Assaf Muller (amuller)
Changed in os-testr:
assignee: nobody → Assaf Muller (amuller)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on os-testr (master)

Change abandoned by Assaf Muller (<email address hidden>) on branch: master
Review: https://review.openstack.org/202299
Reason: I'll let Matthew handle this.

Revision history for this message
李廷 (liting19840711) wrote :

Hello, I have encountered the same problem, how to ask this question how to solve? Thank you

Revision history for this message
Michael Johnson (johnsom) wrote :
Download full text (5.0 KiB)

I am also seeing this:

tox -e py35 -- --until-failure
py35 develop-inst-noop: /home/michjohn/projects/testactactdeltabug/octavia
py35 installed: /home/michjohn/projects/testactactdeltabug/octavia/.tox/py35/lib/python3.5/site.py:165: DeprecationWarning: 'U' mode is deprecated, f = open(fullname, "rU"),actdiag==0.5.4,alabaster==0.7.9,alembic==0.8.9,amqp==1.4.9,anyjson==0.3.3,appdirs==1.4.0,automaton==1.6.0,Babel==2.3.4,bandit==1.4.0,beautifulsoup4==4.5.3,blockdiag==1.5.3,cachetools==2.0.0,cffi==1.9.1,chardet==2.3.0,click==6.7,cliff==2.4.0,cmd2==0.6.9,contextlib2==0.5.4,coverage==4.3.2,cryptography==1.7.1,debtcollector==1.10.0,decorator==4.0.11,doc8==0.7.0,docutils==0.12,dulwich==0.16.3,eventlet==0.19.0,extras==1.0.0,fasteners==0.14.1,fixtures==3.0.0,flake8==2.1.0,Flask==0.12,funcparserlib==0.3.6,futurist==0.20.0,gitdb2==2.0.0,GitPython==2.1.1,graphviz==0.5.2,greenlet==0.4.11,gunicorn==19.6.0,hacking==0.9.6,idna==2.2,iso8601==0.1.11,itsdangerous==0.24,Jinja2==2.8.1,jsonpatch==1.15,jsonpointer==1.10,jsonschema==2.5.1,keystoneauth1==2.17.0,keystonemiddleware==4.13.1,kombu==3.0.37,linecache2==1.0.0,logutils==0.3.3,Mako==1.0.6,MarkupSafe==0.23,mccabe==0.2.1,mock==2.0.0,monotonic==1.2,mox3==0.18.0,msgpack-python==0.4.8,netaddr==0.7.19,netifaces==0.10.5,networkx==1.11,nwdiag==1.0.4,-e git+https://github.com/openstack/octavia.git@da1755d610309f15fd5258f07327784b4bb031e1#egg=octavia,olefile==0.44,os-client-config==1.25.0,os-testr==0.8.0,osc-lib==1.3.0,oslo.concurrency==3.17.0,oslo.config==3.21.0,oslo.context==2.11.0,oslo.db==4.16.0,oslo.i18n==3.11.0,oslo.log==3.19.0,oslo.messaging==5.16.0,oslo.middleware==3.22.0,oslo.policy==1.17.0,oslo.reports==1.16.0,oslo.serialization==2.15.0,oslo.service==1.18.0,oslo.utils==3.21.0,oslosphinx==4.9.0,oslotest==2.12.0,paramiko==2.1.1,Paste==2.0.3,PasteDeploy==1.5.2,pbr==1.10.0,pecan==1.2.1,pep8==1.5.6,pika==0.10.0,pika-pool==0.1.3,Pillow==4.0.0,positional==1.1.1,prettytable==0.7.2,psutil==1.2.1,pyasn1==0.1.9,pyasn1-modules==0.0.8,pycadf==2.4.0,pycparser==2.17,pydotplus==2.0.2,pyflakes==0.8.1,Pygments==2.1.3,pyinotify==0.9.6,PyMySQL==0.7.9,pyOpenSSL==16.2.0,pyparsing==2.1.10,pyroute2==0.4.12,python-barbicanclient==4.1.0,python-dateutil==2.6.0,python-editor==1.0.3,python-glanceclient==2.5.0,python-keystoneclient==3.9.0,python-mimeparse==1.6.0,python-neutronclient==6.0.0,python-novaclient==6.0.0,python-subunit==1.2.0,pytz==2016.10,PyYAML==3.12,reno==2.0.3,repoze.lru==0.6,requests==2.12.4,requests-mock==1.2.0,requestsexceptions==1.1.3,restructuredtext-lint==0.17.2,rfc3986==0.4.1,Routes==2.4.1,seqdiag==0.9.5,simplegeneric==0.8.1,simplejson==3.10.0,six==1.10.0,smmap2==2.0.1,snowballstemmer==1.2.1,Sphinx==1.3.6,sphinx-rtd-theme==0.1.9,sphinxcontrib-actdiag==0.8.5,sphinxcontrib-blockdiag==1.5.5,sphinxcontrib-nwdiag==0.9.5,sphinxcontrib-seqdiag==0.8.5,SQLAlchemy==1.0.16,sqlalchemy-migrate==0.10.0,sqlparse==0.2.2,stevedore==1.19.1,taskflow==2.8.0,tempest==14.0.0,Tempita==0.5.2,tenacity==3.7.1,testrepository==0.0.20,testresources==2.0.1,testscenarios==0.5.0,testtools==2.2.0,traceback2==1.4.0,unittest2==1.1.0,urllib3==1.19.1,waitress==1.0.1,warlock==1.2.0,webcolors==1.7,WebOb==1.6.3,WebTest==2.0.24,Werkzeug==0.11.15,wrapt==1.10....

Read more...

Revision history for this message
Michael Johnson (johnsom) wrote :

Hmm, this could be the shim script is bad. I forgot they added that. Will check.

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.