-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Hit ~80% code coverage on all packages in this repo #3053
Comments
To check the code coverage on a given package, for example,
That will show you all the tests that run, and at the end, a percentage of coverage for that package. To get more detailed info, you can generate a coverage profile like so:
This will produce the same output as the last command, but it will also create a file called
For more information, read through: https://blog.golang.org/cover |
Would be nice to write a script to output code coverage of a package and I'm sure there's some CI service that does it. Does project-repos.ipfs.io
|
It doesn't, unless that is counted by CI. We should include it! |
We can use coveralls for the go projects On Wed, Aug 10, 2016 at 8:13 PM Richard Littauer notifications@github.com
|
Coverage report available at: https://ipfs.io/ipfs/QmTuMtwGCfHrbYyZdQ1RaGNwS2MGsmAkjA8AaB69N7Ya1g/coverage.html#file0 Part of #3053 License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Coverage report available at: https://ipfs.io/ipfs/QmTuMtwGCfHrbYyZdQ1RaGNwS2MGsmAkjA8AaB69N7Ya1g/coverage.html#file0 Part of #3053 License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Coverage report available at: https://ipfs.io/ipfs/QmTuMtwGCfHrbYyZdQ1RaGNwS2MGsmAkjA8AaB69N7Ya1g/coverage.html#file0 Part of #3053 License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Coverage report available at: https://ipfs.io/ipfs/QmTuMtwGCfHrbYyZdQ1RaGNwS2MGsmAkjA8AaB69N7Ya1g/coverage.html#file0 Part of #3053 License: MIT Signed-off-by: Jakub Sztandera <kubuxu@ipfs.io>
I made a script for go-ipfs: https://gist.github.com/Kubuxu/989ab1b51a9f3a0b71479a71abe35427#file-makereprot-sh it should be easily modifiable for other packages, but we should use CoverAlls (or something similar either way). Someone just needs to go through all go repos and set it up. |
I'm happy to help with that? |
Sure, let's try it first on go-ipfs and we will see how it goes. |
Sharness test coverage is done, all of your coverage is at: https://codecov.io/gh/ipfs/go-ipfs/tree/master/ There are lots of places to improve there, if you want to get to know the project structure better, it is great place to start. |
@Kubuxu this is fantastic :) Going to bump this issue to 0.4.7, but i'd say significant progress has been made |
Here are my 2 cents that you might safely ignore: Improving coverage in cmd will come best from pushing code duplicated all around that package into testable methods and functions. Also, some of that functionality should be moved behind the core api to improve reusability in other applications. End-to-end tests are much slower and harder to maintain, because they might break for quite many reasons not related to the goal of that given test. |
All advice is listened to. :) Thanks for adding your 2 cents. |
@wigy-opensource-developer Yeah, youre right. Code in the commands lib needs to be purely 'interface' code that translates user input into function arguments, and turns the codes responses into output. |
Since the 0.4.6 we've seen a very small increase in overall code coverage https://codecov.io/gh/ipfs/go-ipfs/compare/release...master Lets aim for a higher target next release |
Since 0.4.7, we've seen a 0.5% increase in overall code coverage: https://codecov.io/gh/ipfs/go-ipfs/compare/c21c85f...1d59331 Thats better than the previous increase, but still pretty small. I'd love to see a 5% increase on the next release. |
Since 0.4.8, we actually dropped a little bit: :/ |
In order to make releases more painless, and the code more stable and dependable in general I would like to try and hit a goal of at least 80% coverage (line based) on all packages.
Coverage data for master branch is at: https://codecov.io/gh/ipfs/go-ipfs/tree/master/cmd/ipfs
The text was updated successfully, but these errors were encountered: