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

Comments

Projects
None yet
4 participants
@tisto
Copy link
Member

tisto commented Sep 23, 2015

No description provided.

@tisto tisto added the 01 type: bug label Sep 23, 2015

@tisto tisto self-assigned this Sep 23, 2015

@tisto

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

lukasgraf commented Nov 12, 2015

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

This comment has been minimized.

Copy link
Member

tisto commented Nov 12, 2015

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

@tomgross

This comment has been minimized.

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 referenced this issue Feb 27, 2017

Closed

Beethoven Sprint Planning #214

18 of 56 tasks complete

witsch added a commit to witsch/plone.restapi that referenced this issue Mar 4, 2017

erral added a commit that referenced this issue Mar 5, 2017

@witsch

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

tisto commented Mar 10, 2017

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

@tisto tisto closed this Mar 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment