Kyaak / danger-cobertura

Danger plugin to report cobertura coverage
MIT License
5 stars 1 forks source link

Option to check coverage for ALL files, not only modified/added #10

Open orkenstein opened 5 years ago

orkenstein commented 5 years ago

Like mentioned at https://github.com/Kyaak/danger-cobertura/issues/6#issuecomment-456200908

Kyaak commented 5 years ago

Do you mean to include all files in the markdown report or do a general "Overall coverage" ?

orkenstein commented 5 years ago

I'd like to have separate options for both. Say:

cobertura.warn_if_file_less_than(percentage: 80.0, show_all: NO)
cobertura.show_coverage(show_all: YES)
image
Kyaak commented 5 years ago

I see what you mean but I think something like that would be too much output in larger projects. In my opinion the PR should focus only on modified files and not report files which aren't touched.

What I can do is support cobertura.warn_if_file_less_than(percentage: 80.0, show_all: true) but I won't support a markdown table including all projct files. The lines / characters in a comment are also limited.

We can also extend cobertura.show_coverage to look like this:

Code Coverage

Total Project Coverage: 85.69%

...

orkenstein commented 5 years ago

@Kyaak

I see what you mean but I think something like that would be too much output in larger projects

Yes. That's why it should be an option. It is also good for testing. I had to manually add a whitespace to source file to modify it just to expect any output from the plugin. And it took reeeeaaaly long begore I realised that something is broken... That's why this limitation looks artificial to me.

The lines / characters in a comment are also limited.

No problem. Just limit the max output length to some reasonable value.

Kyaak commented 5 years ago

No problem. Just limit the max output length to some reasonable value.

I can't see how that's going to work. I don't know how many messages other plugins are going to do in the same danger comment. Furthermore limiting the output is difficult: which files should be shown? which can be put at last? modified first, then the lowest total percentage files?

I would recommend hosting the complete coverage information on your CI server if possible (Jenkins can keep coverage data)