Skip to content
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

DRAFT : Adding functionality to post code coverage #5

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

theScud
Copy link

@theScud theScud commented Aug 23, 2022

DO NOT MERGE, current in testing.

Sudeep Kini and others added 4 commits August 22, 2022 21:27
1. Adds a enum to specify which files should show warnings
using Danger
2. Add code to generates list of file names from the options
3. Add code to filter warning issues based on file names list
generate above.
1. adds 'failIfCoverageUnavailable' to allow user to fail the build if coverage is'nt avaiable
2. adds 'excludeCoverageTarget' to allow the user to filter out specific targets like pods or tests
3. adds 'showCoverageForChangedFiles' to allow user to show coverage for code changes and 'excludeCoverageForFiles' to exclude specific files
4. add code to support the above config vairables

we first filter out the exculded targets, then exludedFiles. After which we proceed to post the
Overall coverage following the coverage for diff files grouped by target.

yumemi-inc#4
@theScud theScud changed the title Feature/posting code coverage DRAFT : Adding functionality to post code coverage Aug 23, 2022
@el-hoshino el-hoshino self-requested a review August 24, 2022 18:27
@el-hoshino
Copy link
Member

@theScud Sorry, please let me review it at weekend! Still busy on company work

@theScud
Copy link
Author

theScud commented Aug 25, 2022

no worries i still need to test this out, please take your time

Copy link
Member

@el-hoshino el-hoshino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theScud Please have a look!

}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nits]
Please don't remove these blank lines. I made them for better readability.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, would it possible to have a swift format file to the repo, would make it easier to make sure that we stick to convention without any misses

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add it later this week 👍

reportingFileType: ReportingFileType = .all
excludeCoverageTarget: [ExcludedTarget] = [],
excludeCoverageForFiles: @escaping ((RelativeFilePath) -> Bool) = { _ in return false },
showCoverageForChangedFiles: Bool = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[must]
I Think it's probably too complicated now.

shouldFailIfCoverageUnavailable is only needed when codeCoverageRequirement is .required, but it's required even when codeCoverageRequirement is .none

Also excludeCoverageForFiles and showCoverageForChangedFiles are kind of ambiguous that users may feel difficult to determine what exactly they're doing.

My suggestion is

  1. Make a new CodeCoverageReportSettings type
  2. Move CoverageThreshold into that type
  3. Make properties like excludeCoverageTargets inside that type
  4. Make a default initializer for CodeCoverageReportSettings
  5. Change CodeCoverageRequirement.required(CoverageThreshold) to CodeCoverageRequirement.required(CodeCoverageReportSettings)

Properties like parseBuildWarnings and parseBuildErrors may also be moved to another BuildSummaryReportSettings type, but that would be another ticket to fix

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, i'll make the changes

@theScud
Copy link
Author

theScud commented Oct 4, 2022

@el-hoshino i am a little tied up with work currently , i'll post the changes in the first week of November, apologies for the delay

@el-hoshino
Copy link
Member

@theScud Don't worry! Actually I'm also occupied until end of this month; by then I may not be able to review your PR soon either 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants