Add Coverage Report for PR#350
Conversation
Thank you for the pull request! ❤️The Scribe-Android team will do our best to address your contribution as soon as we can. If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the |
Maintainer ChecklistThe following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :) |
|
I would like to know should all the individual packages be shown their coverage amount. From Jacoco I would get package wise coverage report in the main document which would include the coverage for each package. |
b91d025 to
0e41662
Compare
|
Alicia has setup the basis for this long back. I had to add some sample tests for going through the classes to make it work properly. I also noticed that the repository doesn't allow git actions to add comments. So should I make the output from coverage tests run more clean. |
0e41662 to
feec618
Compare
|
Some minor changes are required. I will make it and comment in here when it is ready for review :) |
|
I guess that a massive coverage report for all the files being commented in would be a bit much, so keeping it in the action output and checking a threshold to fail against if it's below it would be enough? What do you think, @angrezichatterbox? :) |
So I would want to make it fail if the overall coverage is less than a certain value right ? |
|
Exactly, and for now just use the current coverage rounded to the highest 5%. We're likely not that high anyway, so hopefully we can at least do 5%, but if not let's just set it to 0 and increase it with new testing issues as they're finished ✅ |
I think it is currently 0 or 0.15 %. Jacoco bot currently return the code coverage of the entire codebase and the changed file. The thing is git actions bot is not able to comment it right now which I am not sure why. I would made the output more clear and will bring in the updated changes by tomorrow. |
|
Ok :) It's also totally fine if we need to check the workflow for the coverage percent, but I trust you to find the appropriate solution 😊 |
38fb0e5 to
ea85389
Compare
ea85389 to
8f9a385
Compare
|
So this is what I have done. I am returning the coverage percentage current. I have not made it fail since currently it's 0 percent. I have also returned the coverage report as an artifact. |
|
Is it possible to also get the coverage report to be printed in the terminal of the job so we can check it directly, @angrezichatterbox? I checked the courage report workflow and did see the artifact being uploaded, but it would also be nice to see the results directly :) |
Okay I will add that change and sent in the updated PR. |
69defaa to
070f66f
Compare
590885d to
2d8b2fc
Compare
f74545e to
8320c8d
Compare
8320c8d to
b3c2a91
Compare
|
Currently I am getting an XML, I could also have a html doc. The idea which comes to my mind is to parse this XML doc and print it as a proper output using a python script. This is what comes to my mind. The existing git actions present in marketplace are now outdated which does the same purpose. Others just give for changed file and the overall coverage. |
|
Doing a Python or Kotlin file to parse the results would be totally fine, @angrezichatterbox! Maybe doing a Python file instead of a Swift file for scribe-org/Scribe-iOS#532 might also make sense as for some reason the Swift file isn't working 🤔 Feel free to add that in and then we'll be good to go! |
I will try using Kotlin but I guess python would be better. If Kotlin does not work I would use python. |
|
Also feel free to just use a Python file. I honestly think that that might be the problem with my workflow for iSO 🤔 |
d0a2c6b to
6c8fff3
Compare
6c8fff3 to
0bc0f50
Compare
|
I have parsed the report and print it on the actions console. It is ready for review :) |
andrewtavis
left a comment
There was a problem hiding this comment.
Amazing work here, @angrezichatterbox! Great that we're getting this done so early in the app's history, and also great that we have it done right before a sync and can discuss next steps 😊 Really awesome that we'll be able to be so directed in our test development, and from there we can work towards test-driven development 🥳
Contributor checklist
./gradlew lintKotlin detekt testcommand as directed in the testing section of the contributing guideDescription
The PR introduces coverage report for the PR.
Related issue