composer icon indicating copy to clipboard operation
composer copied to clipboard

Add coverage report

Open thelittlefireman opened this issue 7 years ago • 4 comments

hi, Could it be possible to add coverage report on tests ? https://developer.android.com/studio/test/command-line.html See "Emma"

Huge Thanks

thelittlefireman avatar Feb 01 '18 15:02 thelittlefireman

You should be able to pass in the instrumentation arg already. The thing that is lacking is pulling the ec file. It might be helpful if composer would pull and rename the ec files for you. But I am concerned about what might happen if you try invoking the instrumentation with the emma argument against an apk that did not get the coverage byte code injected in the build process. maybe some way to parse and detect that?

trevjonez avatar Feb 01 '18 16:02 trevjonez

Yo, yep that's a good feature. However @trevjonez pointed at a valid concern that we should know maybe upfront whether to expect coverage files or not

On one hand we want Composer to be abstract enough to support different test runners, screenshoters and so on. On the other hand we already support Spoon-styled file structure for pulling screenshots and files produced by individual test cases.

So if we add support for pulling codecoverage files in the same manner, that should be relatively fine from design view. Sounds like a valid balance between having "ideal design" and being pragmatic

@yunikkk what do you think?

artem-zinnatullin avatar Feb 02 '18 00:02 artem-zinnatullin

I think its fine. We can have default coverage report pulling and an option to customize it somehow for flexibility.

yunikkk avatar Feb 02 '18 09:02 yunikkk

Great, I'm all in for initial support then!

PRs welcome, I believe coverage could be very interesting for Juno as well, maybe @yunikkk or @ming13 could work on it?

We can start just with pulling the coverage report files from devices/emulators so then they could be piped into systems like Codecov, later we could integrate with Jacoco's HTML report and generate it pretty much the same way Gradle Jacoco plugin does it and make a link to Jacoco HTML report from Composer HTML report

artem-zinnatullin avatar Feb 02 '18 19:02 artem-zinnatullin