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

Enforce 100% code coverage when testing #163

Merged
merged 3 commits into from Mar 21, 2013

Conversation

t-8ch
Copy link
Contributor

@t-8ch t-8ch commented Mar 21, 2013

No description provided.

@@ -336,3 +336,6 @@ def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None,
return wrap_socket(sock, keyfile=keyfile, certfile=certfile,
ca_certs=ca_certs, cert_reqs=cert_reqs,
ssl_version=ssl_version)

def i_am_broken():
Copy link
Member

@shazow shazow Mar 21, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this leftover from debugging?

Copy link
Contributor Author

@t-8ch t-8ch Mar 21, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. I want Travis to fail on this. As a meta meta (sic) test case.

@t-8ch
Copy link
Contributor Author

t-8ch commented Mar 21, 2013

Success. Missing coverage makes Travis fail:
https://travis-ci.org/shazow/urllib3/builds/5692820

@shazow
Copy link
Member

shazow commented Mar 21, 2013

gtUdBeKs

shazow added a commit that referenced this issue Mar 21, 2013
Enforce 100% code coverage when testing.
@shazow shazow merged commit 384d142 into urllib3:master Mar 21, 2013
@shazow
Copy link
Member

shazow commented Mar 22, 2013

Looks like pypy doesn't like coverage on travis. Should we remove pypy from the build matrix?

@t-8ch
Copy link
Contributor Author

t-8ch commented Mar 22, 2013

Weird. It works for me locally with pypy 1.9.0 and 2.0.0-beta1.
I'll look into it tomorrow, feel free to remove it for now.

@shazow
Copy link
Member

shazow commented Mar 22, 2013

Will do, thanks!

@t-8ch
Copy link
Contributor Author

t-8ch commented Mar 23, 2013

It seems to be a bug in coverage.py.
I could not reproduce this as the result of the coverage is serialized to .coverage and then reused on subsequent runs.
If I delete this file before running I also get random noncovered lines.
The weird thing is, that it reports lines as uncovered that are definitely not, because I inserted print()-statements which are getting executed (at least my screen tells me so).
I suspect this is somehow related to threading and pypys garbage collection.

A workaround could be to not enforce coverage on pypy.

@shazow
Copy link
Member

shazow commented Mar 23, 2013

Funsies.

Can we even do that? Setup travis to only enforce coverage for everything except pypy? I'm okay with not testing pypy, but it would be a nice to have.

@sigmavirus24
Copy link
Contributor

sigmavirus24 commented Mar 24, 2013

You can set up the build matrix so that pypy errors are allowed, e.g.,

matrix:
  allow_failures:
    - pypy

@t-8ch
Copy link
Contributor Author

t-8ch commented Mar 24, 2013

I think appending --cover-min-percentage=0 to the nose commandline for pypy in .travis.yml and tox.ini would be better, as this doesn't disable functional tests.
Remains the problem with reused coveragedata with tox. Nose has the setting cover-erase which should do the right thing.

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.

None yet

3 participants