fastlane-community / danger-xcov

Danger plugin to validate the code coverage of the files changed in a pull request

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scheme name not shown on danger error message

joanromano opened this issue · comments

Hi, thanks for this plugin - I am trying to integrate it within our ci pipeline and so far the integration it's been pretty smooth.

We have a workspace composed of many subprojects/schemes, and I run the xcov plugin multiple times within our Dangerfile. This gives me different coverage reports per different schemes which is pretty handy. The only issue I am facing is that, if I get errors on minimum coverage not met in more than one scheme, the message does not show the name of that particular scheme:

screen shot 2017-12-18 at 9 46 48 am

Would it be possible to change this to show the name of that scheme as well? I'd be more than happy to submit a PR if that's the case.

@joanromano How do you run the plugin multiple times for multiple schemes?

Running xcov.report(...) multiple times within the same Dangerfile seems to be resulting in Danger only commenting with the markdown report of the last one specified.

Hey @macdoum1 what I do is generate the markdown manually. You can do so by accessing your generated Report's targets property and then markdown_value in each of them. You can find all that information in Xcov models

@joanromano I'm trying to accomplish exactly what you did. Can you give more specific example of how you managed to generate code coverage for different test targets, without Danger overwriting it?

@Vadimkomis sorry I don't have that code with me anymore, but as I said before you should be able to access all the generated Reports and manually tweak them

@joanromano are you talking about this function in the Xcov modals:
def markdown_value markdown = "## Current coverage for #{@name} is `#{@displayable_coverage}`\n" return markdown << "✅ *No files affecting coverage found*\n\n---\n" if @files.empty? markdown << "Files changed | - | - \n--- | --- | ---\n" markdown << "#{@files.map { |file| file.markdown_value }.join("")}\n---\n" markdown end