-
Notifications
You must be signed in to change notification settings - Fork 203
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
Reported code coverage of TravisCI/coveralls confusing (mixes app and unit test code coverage) #1282
Comments
I think modifying the .coveragerc config file could work to exclude the unit tests from the overall reported coverage. I suggest to add this line under in
@emtiu Since
|
Fact is that the BIT repo currently doesn't follow any (official) recommendations how a project folder should be layouted. This is a big topic we need to discuss later and at the dev-list. But in context of code coverage. I vote for remove code coverage from make, from travis and from the readme. This info is useless at this points. Why does Travis need that number? Does it give a red light when the number is under a threshold? Each developer should run its own coverage on its local copy of the repo. |
This is a valid opinion and esp. the end user doesn't care much about code coverage or the "total coverage" magic number. I personally (as developer) do heavily use code coverage to identify source code lines that are not yet covered by unit tests My usual workflow is to create the code coverage report with Then I write a unit test that will call this untested part of the code. So creating and using code coverage reports are essential for me.
Travis/Ci doesn't care but there could and should be a policy for each non-trival project
That is exactly why I have added the make target "coverage" in my pull request
So I am asking to keep the code coverage things in the project and merge my pull request :-) |
OK, you convinced me. We are on the same train about that topic. Currently I don't care about that number because even the tests that are existing are not "good enough" for me to make me well sleeping at night. The tests are nearly undocumented and unreadable. You have to dive into it to understand it. Currently it feels to me that we don't have any tests. ;) Beside the new Issue triage, the exploring of unittests and creating new ones would be one of my primary tasks; just to give me a better sleep. In short: I'm paranoid when it comes to tests. ;) |
Perfect, unit tests are a good way to understand existing code step-by-step and even become a better programmer. I would use one test code file per source code file or perhaps even per "function/class under test". The challenge is always to keep the test code and file names in sync with the class/function and file names "under test" after every renaming (eg. during refactoring). |
Becomes invalid if #1463 is solved. |
I have measured the code coverage of the app code (GUI and backend) as described in #1279.
I found an app code coverage of about 33 % while the coverage badge at the
backintime
README.md start page claims 74 %.33 % vs. 74 % is a huge difference and misleading IMHO.
Reason:
The travisCI/coveralls code coverage also considers the unit test source files when calculating the overall code coverage.
Since the unit tests are all executed (at nearly 100 %) to estimate the app code coverage the distort the coverage result.
Proposal:
The goal is of TravisCI/coveralls is mainly to estimate the test coverage of the app code itself.
So I propose to
This is just required to find unit test code fragments that not executed eg. due programming errors.
This make target should be used during development to check if the unit tests are executed as designed.
See also the documentation of travisCI/coveralls:
https://coveralls-python.readthedocs.io/en/latest/
The text was updated successfully, but these errors were encountered: