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

Test coverage dropped below 100%. #33

Closed
tisto opened this issue Sep 23, 2015 · 6 comments
Closed

Test coverage dropped below 100%. #33

tisto opened this issue Sep 23, 2015 · 6 comments

Comments

@tisto
Copy link
Member

tisto commented Sep 23, 2015

No description provided.

@tisto tisto self-assigned this Sep 23, 2015
@tisto
Copy link
Member Author

tisto commented Sep 23, 2015

Name                                          Stmts   Miss  Cover   Missing
---------------------------------------------------------------------------
src/plone/restapi/__init__                        2      0   100%   
src/plone/restapi/demo/__init__                   0      0   100%   
src/plone/restapi/demo/demo                       0      0   100%   
src/plone/restapi/interfaces                      5      0   100%   
src/plone/restapi/serializer                     73      7    90%   116, 122, 190-197
src/plone/restapi/services                        8      2    75%   9, 33
src/plone/restapi/testing                        17      0   100%   
src/plone/restapi/tests/__init__                  0      0   100%   
src/plone/restapi/tests/test_documentation      135      0   100%   
src/plone/restapi/tests/test_error_handling      50     30    40%   37-48, 52-65, 72-84, 91-113
src/plone/restapi/tests/test_serializer          73      0   100%   
src/plone/restapi/tests/test_services            75      0   100%   
src/plone/restapi/tests/test_setup               13      0   100%   
src/plone/restapi/tests/test_utils               41      0   100%   
src/plone/restapi/utils                          25      0   100%   
---------------------------------------------------------------------------
TOTAL                                           517     39    92%   

@lukasgraf
Copy link
Member

Tests using a z2.ZSERVER fixture, like those on PLONE_RESTAPI_FUNCTIONAL_TESTING, don't seem to be picked up by coverage.py.

I'm assuming this is because coverage.py can't trace threads that are instantiated using the low-level thread interface instead of the higher level threading module (see coveragepy#244 and ZServer.PubCore.ZRendezvous).

So... Functional tests using a Z2 server and the requests module won't have their coverage recorded.

@tisto
Copy link
Member Author

tisto commented Nov 12, 2015

Yep. That seems to be the problem. This is not limited to plone.restapi though.

@tomgross
Copy link
Member

tomgross commented Feb 5, 2016

You can enforce a minimun of tests to be covered with nose:

--cover-min-percentage=DEFAULT
Minimum percentage of coverage for tests to pass [NOSE_COVER_MIN_PERCENTAGE]

See:
http://nose.readthedocs.org/en/latest/plugins/cover.htm

@tisto tisto added this to the 1.0 milestone Nov 26, 2016
@tisto tisto mentioned this issue Feb 27, 2017
56 tasks
witsch added a commit to witsch/plone.restapi that referenced this issue Mar 4, 2017
erral pushed a commit that referenced this issue Mar 5, 2017
@witsch
Copy link
Member

witsch commented Mar 5, 2017

Test coverage is back to 96% with #238, but the rest will probably take some (tedious) work. I support you might want to close this anyway… :)

@tisto
Copy link
Member Author

tisto commented Mar 10, 2017

Wohoo! Yeah. Will close this one and create a new ticket...

@tisto tisto closed this as completed Mar 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants