-
Notifications
You must be signed in to change notification settings - Fork 24
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
Option for comparing coverage reports #92
Comments
Ye this is a great idea, I've also wanted something similar for elapsed .. to understand if there's a trend over time where tests get slower/faster. Something I haven't thought deeply about is where things like "main-coverage.json" come from, are they checked-in? |
Glad to hear! My first guess would be to have "main-coverage.json" checked in, that file could for example be automatically created and pushed to the main branch by Actions. A possible alternative would be to store and retrieve it from, for example, a storage bucket, or any other place that can provide a static URL to the file. However, I think "where does the file come from?" shouldn't be a concern of |
Curious, when Sorry, I might be missing something 😅 , but is this a file I ask because I'm failing to recall what .json file the go toolchain produces. EDIT: IIRC there are tools like https://github.com/axw/gocov that can produce a .json file |
The first that comes to mind is writing the output of The most idiomatic way of doing it would be to parse the coverage file that you can get with I have been searching for a tool for presenting tests results, and I picked
|
This is great feedback! At one point I thought about adding a I know I've been saying this for a while, but I do intend to find some time this summer to get this tool to a stable v1 and address a few of the open issues. (I still write a lot of Go code, and use this tool quite a bit). |
@mfridman Great to hear. I'll be happy to help if/when I have some free time, but no promises. This issue is the most interesting for me, so if we agree on the (rough) design, I will give it a try. |
I had a look at the source code, reading and parsing a file to compare against would be quite simple. Besides adding the
|
Was hacking on Presumably when running There are at least 2 ways we can go .. have Fwiw I really like this idea, and with a bit of guidance can help get something in place. |
Hey @mfridman! Thanks for looking into this. My preference for the format would be the raw test output. It is not ideal because Go already has a coverage format that is more "semantically" correct, however, |
Hey @mfridman, awesome work! The happy path looks great, and I agree with you on having About the question, I think I would like a decrease in coverage to be obvious at a glance. Do you think it'd be possible to have the |
Merged a crude implementation in #101
Thanks for the great suggestion. There's still a bit of cleanup to do, but overall I think it's a good first step.. |
🎉 Great work, glad I could be of help! |
At this moment,
tparse
shows the current coverage percentage. It would be useful to show, next to the current percentage, the difference with another given test report, for example one containing the coverage information for themain
branch.I am thinking of something like:
Which results in a table like:
This would make it easy and quick to see if a pull request is increasing or decreasing a project's test coverage.
The text was updated successfully, but these errors were encountered: