Cannot test only coverage

Bug #1628719 reported by Yushiro FURUKAWA
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Monasca
In Progress
Undecided
Yushiro FURUKAWA

Bug Description

I tried to execute 'tox -e cover', but following error has occurred:

I think there are 2 bugs:

  1. requirement package("influxdb" and "cassandra-drivers") is not defined at test-requirements.txt but tox.ini for only [testenv] section.
  2. coverage option "--coverage-package-name" is missing. This is necessary when the directory name is different like "monasca-api" and "monasca_api".

[Environment]
master(Last commit: 2bb7c963152bca04912f3b154818f8f3d6abfd0f

[How to reprocude]
$ git clone https://github.com/openstack/monasca-api.git
$ cd monasca-api
$ tox -e cover

[Result]
cover recreate: /home/work/workspace/monasca-api/.tox/cover
cover installdeps: -r/home/work/workspace/monasca-api/requirements.txt, -r/home/work/workspace/monasca-api/test-requirements.txt
cover develop-inst: /home/work/workspace/monasca-api
cover installed: appdirs==1.4.0,Babel==2.3.4,cffi==1.8.3,coverage==4.2,cryptography==1.5.1,debtcollector==1.8.0,enum34==1.1.6,eventlet==0.19.0,extras==1.0.0,falcon==1.0.0,fixtures==3.0.0,flake8==2.5.5,funcsigs==1.0.2,functools32==3.2.3.post2,greenlet==0.4.10,hacking==0.10.2,httplib2==0.9.2,idna==2.1,ipaddress==1.0.17,iso8601==0.1.11,Jinja2==2.8,jsonschema==2.5.1,kafka-python==0.9.5,kazoo==2.2.1,keystoneauth1==2.12.1,keystonemiddleware==4.9.0,linecache2==1.0.0,MarkupSafe==0.23,mccabe==0.2.1,mock==2.0.0,-e git+https://github.com/openstack/monasca-api.git@2bb7c963152bca04912f3b154818f8f3d6abfd0f#egg=monasca_api,monasca-common==1.1.0,monotonic==1.2,mox==0.5.3,mox3==0.18.0,msgpack-python==0.4.8,netaddr==0.7.18,netifaces==0.10.5,nose==1.3.7,-e git+https://git.openstack.org/openstack/requirements@53deafe3ba691ce37a48924154947651de4cb06c#egg=openstack.requirements,os-client-config==1.21.1,os-testr==0.7.0,oslo.config==3.17.0,oslo.context==2.9.0,oslo.i18n==3.9.0,oslo.log==3.16.0,oslo.middleware==3.19.0,oslo.serialization==2.13.0,oslo.utils==3.16.0,oslotest==2.10.0,packaging==16.7,paramiko==2.0.2,Parsley==1.3,PasteDeploy==1.5.2,pbr==1.10.0,pep8==1.5.7,positional==1.1.1,pyasn1==0.1.9,pycadf==2.4.0,pycparser==2.14,pyflakes==0.8.1,pyinotify==0.9.6,PyMySQL==0.7.9,pyparsing==2.1.9,python-dateutil==2.5.3,python-keystoneclient==3.5.0,python-mimeparse==1.5.2,python-subunit==1.2.0,pytz==2016.6.1,PyYAML==3.12,requests==2.11.1,requestsexceptions==1.1.3,rfc3986==0.4.1,simplejson==3.8.2,six==1.10.0,SQLAlchemy==1.0.15,stevedore==1.17.1,tempest-lib==1.0.0,testrepository==0.0.20,testscenarios==0.5.0,testtools==2.2.0,traceback2==1.4.0,ujson==1.35,unittest2==1.1.0,voluptuous==0.9.3,WebOb==1.6.1,wrapt==1.10.8
cover runtests: PYTHONHASHSEED='1312201449'
cover runtests: commands[0] | python setup.py testr --coverage --testr-args=^(?!.*test.*coverage).*$
running testr
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
${PYTHON:-python} -m subunit.run discover -t . ./monasca_api/tests --list
Coverage.py warning: Module monasca-api was never imported.
Coverage.py warning: No data was collected.
--- import errors ---
Failed to import test module: monasca_api.tests.test_repositories
Traceback (most recent call last):
  File "/home/work/workspace/monasca-api/.tox/cover/local/lib/python2.7/site-packages/unittest2/loader.py", line 456, in _find_test_path
    module = self._get_module_from_name(name)
  File "/home/work/workspace/monasca-api/.tox/cover/local/lib/python2.7/site-packages/unittest2/loader.py", line 395, in _get_module_from_name
    __import__(name)
  File "monasca_api/tests/test_repositories.py", line 22, in <module>
    import monasca_api.common.repositories.cassandra.metrics_repository as cassandra_repo
  File "monasca_api/common/repositories/cassandra/metrics_repository.py", line 24, in <module>
    from cassandra.cluster import Cluster
ImportError: No module named cassandra.cluster
Non-zero exit code (2) from test listing.
error: testr failed (3)
ERROR: InvocationError: '/home/work/workspace/monasca-api/.tox/cover/bin/python setup.py testr --coverage --testr-args=^(?!.*test.*coverage).*$'
_________________________________________________________________________________________________ summary _________________________________________________________________________________________________
ERROR: cover: commands failed

Tags: monasca-api
Changed in monasca:
assignee: nobody → Yushiro FURUKAWA (y-furukawa-2)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to monasca-api (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/379042

Changed in monasca:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to monasca-api (master)

Fix proposed to branch: master
Review: https://review.openstack.org/379043

summary: - cannot test only coverage
+ Cannot test only coverage
tags: added: monasca-api
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on monasca-api (master)

Change abandoned by Tomasz Trębski (<email address hidden>) on branch: master
Review: https://review.openstack.org/379043
Reason: Handled in another change

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to monasca-api (master)

Reviewed: https://review.openstack.org/379042
Committed: https://git.openstack.org/cgit/openstack/monasca-api/commit/?id=a4fe9f86c51ef47f47efd2aff89aab85abc7b0b4
Submitter: Jenkins
Branch: master

commit a4fe9f86c51ef47f47efd2aff89aab85abc7b0b4
Author: Yushiro FURUKAWA <email address hidden>
Date: Thu Sep 29 09:11:34 2016 +0900

    Use them same versions of Influx or Cassandra

    Versions of Influx or Cassandra between tox and devstack
    env were different. Now in both places OpenStack requirements
    are used.

    Additionally:
    - moved Influx and Cassandra to test-requirements.

    Change-Id: I5be1be023b605a0b7efe718796877b90f9dc06f0
    Related-Bug: #1628719

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.