Skip to content

Do we need to run py27 **AND** cover on Travis #1109

@dhermes

Description

@dhermes

tox -e cover already runs all the tests in tox -e py27 (it has to so that it can generate the coverage report)

To make sure cover fails even if there is 100% coverage but failing tests, I added

diff --git a/gcloud/datastore/test_client.py b/gcloud/datastore/test_client.py
index 4fed6d9..a8d482f 100644
--- a/gcloud/datastore/test_client.py
+++ b/gcloud/datastore/test_client.py
@@ -925,6 +925,9 @@ class TestClient(unittest2.TestCase):
         }
         self.assertEqual(query.kwargs, expected_kwargs)

+    def test_nope_dan(self):
+        self.assertTrue(False)
+

 class _Dummy(object):

and then tox -e cover fails even with 100% coverage

$ tox -e cover
GLOB sdist-make: /path/to/gcloud-python/setup.py
cover inst-nodeps: /path/to/gcloud-python/.tox/dist/gcloud-0.7.1.zip
cover installed: coverage==3.7.1,-e git+git@github.com:dhermes/gcloud-python.git@0dfe5ebc936c141e8f3ca13733b69f68155fe76f#egg=gcloud-master,google-apitools==0.4.8,httplib2==0.9.1,linecache2==1.0.0,nose==1.
3.7,nosexcover==1.0.10,oauth2client==1.4.12,protobuf==3.0.0a1,protorpc==0.10.0,pyasn1==0.1.8,pyasn1-modules==0.0.7,pycrypto==2.6.1,rsa==3.2,six==1.9.0,traceback2==1.4.0,unittest2==1.1.0,wheel==0.24.0
cover runtests: PYTHONHASHSEED='2394164928'
cover runtests: commands[0] | /path/to/gcloud-python/scripts/cover.sh --cover-min-percentage=100

nosetests --ignore-files=run_system_test\.py \
--with-xunit --with-xcoverage --cover-package=gcloud \
--nocapture --cover-erase --cover-tests --cover-branches ${@}
......................................................................................................................................................................................F......................
.............................................................................................................................................................................................................
.............................................................................................................................................................................................................
.............................................................................................................................................................................................................
.........................................................................
======================================================================
FAIL: test_nope_dan (gcloud.datastore.test_client.TestClient)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/path/to/gcloud-python/gcloud/datastore/test_client.py", line 929, in test_nope_dan
    self.assertTrue(False)
AssertionError: False is not true

Name                                      Stmts   Miss Branch BrMiss  Cover   Missing
-------------------------------------------------------------------------------------
gcloud                                        3      0      0      0   100%
gcloud._helpers                              89      0     16      0   100%

...

gcloud.test_iterator                        145      0      2      0   100%
-------------------------------------------------------------------------------------
TOTAL                                     14844      0   1125      0   100%
----------------------------------------------------------------------
Ran 893 tests in 0.907s

FAILED (failures=1)
ERROR: InvocationError: '/path/to/gcloud-python/scripts/cover.sh --cover-min-percentage=100'
__________________________________________________________________________________________________ summary __________________________________________________________________________________________________
ERROR:   cover: commands failed

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions