Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: update coverage reporting #275

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

terencehonles
Copy link
Contributor

Add printing test coverage information to stdout when running tox, and fix the numbers so coverage information is only for the source not the tests or the standard library.

@deathbird this continues off of my comment: #269 (comment)

I had updated tox to print the coverage information locally (so you don't have to wait for the CI to get it), and when doing that I had noticed it was looping in stdlib and tests into the coverage information.

This is with and without the --source txclib change. If you look at the files at the end (txclib) you'll notice that they all line up.

Without:

py27-vanilla run-test: commands[3] | bash -c 'if [[ -n "$CI" ]]; then codecov -e TOX_ENV_NAME; else coverage report; fi'
Name                                                                                                   Stmts   Miss  Cover
--------------------------------------------------------------------------------------------------------------------------
.eggs/funcsigs-1.0.2-py2.7.egg/funcsigs/__init__.py                                                      432    254    41%
.eggs/funcsigs-1.0.2-py2.7.egg/funcsigs/version.py                                                         1      0   100%
.eggs/mock-3.0.5-py2.7.egg/mock/__init__.py                                                                4      0   100%
.eggs/mock-3.0.5-py2.7.egg/mock/mock.py                                                                 1390    568    59%
.tox/py27-vanilla/lib/python2.7/distutils/__init__.py                                                     84     37    56%
.tox/py27-vanilla/lib/python2.7/site-packages/certifi/__init__.py                                          2      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/certifi/core.py                                              5      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/__init__.py                                         11      7    36%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/big5freq.py                                          3      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/big5prober.py                                       14      6    57%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/chardistribution.py                                117     83    29%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/charsetgroupprober.py                               70     61    13%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/charsetprober.py                                    50     36    28%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/codingstatemachine.py                               27     18    33%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/compat.py                                           10      4    60%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/cp949prober.py                                      14      6    57%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/enums.py                                            34      1    97%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/escprober.py                                        56     45    20%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/escsm.py                                            17      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/eucjpprober.py                                      47     34    28%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/euckrfreq.py                                         3      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/euckrprober.py                                      14      6    57%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/euctwfreq.py                                         3      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/euctwprober.py                                      14      6    57%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/gb2312freq.py                                        3      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/gb2312prober.py                                     14      6    57%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/hebrewprober.py                                     74     48    35%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/jisfreq.py                                           3      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/jpcntx.py                                           80     61    24%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/langbulgarianmodel.py                                5      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/langcyrillicmodel.py                                13      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/langgreekmodel.py                                    5      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/langhebrewmodel.py                                   3      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/langthaimodel.py                                     3      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/langturkishmodel.py                                  3      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/latin1prober.py                                     50     29    42%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/mbcharsetprober.py                                  42     33    21%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/mbcsgroupprober.py                                  14      3    79%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/mbcssm.py                                           41      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/sbcharsetprober.py                                  73     60    18%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/sbcsgroupprober.py                                  19      8    58%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/sjisprober.py                                       47     34    28%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/universaldetector.py                               124    104    16%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/utf8prober.py                                       41     29    29%
.tox/py27-vanilla/lib/python2.7/site-packages/chardet/version.py                                           2      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/idna/__init__.py                                             2      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/idna/core.py                                               280    244    13%
.tox/py27-vanilla/lib/python2.7/site-packages/idna/idnadata.py                                             4      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/idna/intranges.py                                           29     24    17%
.tox/py27-vanilla/lib/python2.7/site-packages/idna/package_data.py                                         1      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/pkg_resources/__init__.py                                 1553    573    63%
.tox/py27-vanilla/lib/python2.7/site-packages/pkg_resources/_vendor/__init__.py                            0      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/pkg_resources/_vendor/appdirs.py                           250    219    12%
.tox/py27-vanilla/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/__about__.py                10      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/__init__.py                  3      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/_compat.py                  12      1    92%
.tox/py27-vanilla/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/_structures.py              41     17    59%
.tox/py27-vanilla/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/markers.py                 130     18    86%
.tox/py27-vanilla/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/requirements.py             72     10    86%
.tox/py27-vanilla/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/specifiers.py              284    149    48%
.tox/py27-vanilla/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/version.py                 150     44    71%
.tox/py27-vanilla/lib/python2.7/site-packages/pkg_resources/_vendor/pyparsing.py                        2533   1309    48%
.tox/py27-vanilla/lib/python2.7/site-packages/pkg_resources/_vendor/six.py                               444    204    54%
.tox/py27-vanilla/lib/python2.7/site-packages/pkg_resources/extern/__init__.py                            35      6    83%
.tox/py27-vanilla/lib/python2.7/site-packages/pkg_resources/py31compat.py                                 12      5    58%
.tox/py27-vanilla/lib/python2.7/site-packages/requests/__init__.py                                        55     13    76%
.tox/py27-vanilla/lib/python2.7/site-packages/requests/__version__.py                                     10      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/requests/_internal_utils.py                                 16     12    25%
.tox/py27-vanilla/lib/python2.7/site-packages/requests/adapters.py                                       222    169    24%
.tox/py27-vanilla/lib/python2.7/site-packages/requests/api.py                                             22     12    45%
.tox/py27-vanilla/lib/python2.7/site-packages/requests/auth.py                                           174    139    20%
.tox/py27-vanilla/lib/python2.7/site-packages/requests/certs.py                                            4      1    75%
.tox/py27-vanilla/lib/python2.7/site-packages/requests/compat.py                                          38     14    63%
.tox/py27-vanilla/lib/python2.7/site-packages/requests/cookies.py                                        238    177    26%
.tox/py27-vanilla/lib/python2.7/site-packages/requests/exceptions.py                                      35      6    83%
.tox/py27-vanilla/lib/python2.7/site-packages/requests/hooks.py                                           15     11    27%
.tox/py27-vanilla/lib/python2.7/site-packages/requests/models.py                                         446    374    16%
.tox/py27-vanilla/lib/python2.7/site-packages/requests/packages.py                                         6      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/requests/sessions.py                                       284    233    18%
.tox/py27-vanilla/lib/python2.7/site-packages/requests/status_codes.py                                    15      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/requests/structures.py                                      39     19    51%
.tox/py27-vanilla/lib/python2.7/site-packages/requests/utils.py                                          443    376    15%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/__init__.py                                     101     31    69%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/_deprecation_warning.py                           1      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/_vendor/__init__.py                               0      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/_vendor/packaging/__about__.py                   10      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/_vendor/packaging/__init__.py                     3      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/_vendor/packaging/_compat.py                     12      1    92%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.py                 41     17    59%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.py                 284    190    33%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/_vendor/packaging/utils.py                        5      1    80%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.py                    150     78    48%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/_vendor/six.py                                  444    199    55%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/archive_util.py                                  87     71    18%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/command/__init__.py                               8      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/command/bdist_egg.py                            313    263    16%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/command/build_ext.py                            193    126    35%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/command/build_py.py                             152     89    41%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/command/easy_install.py                        1270    873    31%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/command/egg_info.py                             410    118    71%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/command/install.py                               62     33    47%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/command/install_lib.py                           61     48    21%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/command/install_scripts.py                       45     34    24%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/command/py36compat.py                            75     26    65%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/command/sdist.py                                123     70    43%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/command/setopt.py                                79     57    28%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/command/test.py                                 164     34    79%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/config.py                                       270    197    27%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/depends.py                                       97     76    22%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/dist.py                                         624    347    44%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/extension.py                                     29     15    48%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/extern/__init__.py                               35      6    83%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/glibc.py                                         31     23    26%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/glob.py                                          92     30    67%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/lib2to3_ex.py                                    41     40     2%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/monkey.py                                        78     33    58%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/msvc.py                                         527    424    20%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/package_index.py                                643    491    24%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/pep425tags.py                                   168    131    22%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/py27compat.py                                    10      2    80%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/py33compat.py                                    35     17    51%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/sandbox.py                                      257    155    40%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/ssl_support.py                                  136     92    32%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/unicode_utils.py                                 28     14    50%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/version.py                                        5      2    60%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/wheel.py                                        114     85    25%
.tox/py27-vanilla/lib/python2.7/site-packages/setuptools/windows_support.py                               15      9    40%
.tox/py27-vanilla/lib/python2.7/site-packages/six.py                                                     450    202    55%
.tox/py27-vanilla/lib/python2.7/site-packages/slugify/__init__.py                                          4      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/slugify/slugify.py                                          91     40    56%
.tox/py27-vanilla/lib/python2.7/site-packages/unidecode/__init__.py                                       45     30    33%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/__init__.py                                         33      8    76%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/_collections.py                                    181    125    31%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/connection.py                                      165    109    34%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/connectionpool.py                                  314    213    32%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/contrib/__init__.py                                  0      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/contrib/_appengine_environ.py                       11      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/contrib/pyopenssl.py                               238    236     1%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/contrib/socks.py                                    75     66    12%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/exceptions.py                                       96     21    78%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/fields.py                                           69     56    19%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/filepost.py                                         43     30    30%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/packages/__init__.py                                 3      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/packages/six.py                                    444    202    55%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/packages/ssl_match_hostname/__init__.py             11      1    91%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/packages/ssl_match_hostname/_implementation.py      73     60    18%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/poolmanager.py                                     170    125    26%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/request.py                                          39     27    31%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/response.py                                        353    290    18%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/util/__init__.py                                    10      0   100%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/util/connection.py                                  66     45    32%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/util/queue.py                                       14      1    93%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/util/request.py                                     45     21    53%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/util/response.py                                    35     29    17%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/util/retry.py                                      150    102    32%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/util/ssl_.py                                       146    113    23%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/util/timeout.py                                     59     34    42%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/util/url.py                                        107     31    71%
.tox/py27-vanilla/lib/python2.7/site-packages/urllib3/util/wait.py                                        77     57    26%
setup.py                                                                                                   7      0   100%
tests/__init__.py                                                                                          0      0   100%
tests/test_api.py                                                                                         39      0   100%
tests/test_commands.py                                                                                   275      2    99%
tests/test_paths.py                                                                                       24      0   100%
tests/test_processors.py                                                                                  31      7    77%
tests/test_project.py                                                                                    557      4    99%
tests/test_utils.py                                                                                      186      1    99%
tests/test_wizard.py                                                                                      48      0   100%
txclib/__init__.py                                                                                         1      0   100%
txclib/api.py                                                                                             45     10    78%
txclib/cmdline.py                                                                                         58     22    62%
txclib/commands.py                                                                                       380     85    78%
txclib/config.py                                                                                          82     32    61%
txclib/exceptions.py                                                                                      18      0   100%
txclib/log.py                                                                                             22      1    95%
txclib/messages.py                                                                                        13      0   100%
txclib/parsers.py                                                                                        141     24    83%
txclib/paths.py                                                                                            7      0   100%
txclib/processors.py                                                                                      23      1    96%
txclib/project.py                                                                                        819    325    60%
txclib/urls.py                                                                                             2      0   100%
txclib/utils.py                                                                                          388     95    76%
txclib/web.py                                                                                             15      2    87%
txclib/wizard.py                                                                                         116     42    64%
--------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                                  25230  13441    47%
_______________________________________________________ summary ________________________________________________________
  py27-vanilla: commands succeeded
  congratulations :)

With:

py27-vanilla run-test: commands[3] | bash -c 'if [[ -n "$CI" ]]; then codecov -e TOX_ENV_NAME; else coverage report; fi'
Name                   Stmts   Miss  Cover
------------------------------------------
txclib/__init__.py         1      0   100%
txclib/__main__.py         2      2     0%
txclib/api.py             45     10    78%
txclib/cmdline.py         58     22    62%
txclib/commands.py       380     85    78%
txclib/config.py          82     32    61%
txclib/exceptions.py      18      0   100%
txclib/log.py             22      1    95%
txclib/messages.py        13      0   100%
txclib/parsers.py        141     24    83%
txclib/paths.py            7      0   100%
txclib/processors.py      23      1    96%
txclib/project.py        819    325    60%
txclib/urls.py             2      0   100%
txclib/utils.py          388     95    76%
txclib/web.py             15      2    87%
txclib/wizard.py         116     42    64%
------------------------------------------
TOTAL                   2132    641    70%
__________________________________________________________________________________ summary ___________________________________________________________________________________
  py27-vanilla: commands succeeded
  congratulations :)

Add printing test coverage information to stdout when running tox, and
fix the numbers so coverage information is only for the source not the
tests or the standard library.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant