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
Adds codeCoverageTargets to TestAction #619
Conversation
13ae259
to
794a7eb
Compare
@@ -161,6 +161,18 @@ final class SchemesGenerator: SchemesGenerating { | |||
var testables: [XCScheme.TestableReference] = [] | |||
var preActions: [XCScheme.ExecutionAction] = [] | |||
var postActions: [XCScheme.ExecutionAction] = [] | |||
var codeCoverageTargets: [XCScheme.BuildableReference] = [] | |||
|
|||
testAction.codeCoverageTargets.forEach { name in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add a unit test to make sure that the buildable references are added to the scheme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
@@ -161,6 +161,18 @@ final class SchemesGenerator: SchemesGenerating { | |||
var testables: [XCScheme.TestableReference] = [] | |||
var preActions: [XCScheme.ExecutionAction] = [] | |||
var postActions: [XCScheme.ExecutionAction] = [] | |||
var codeCoverageTargets: [XCScheme.BuildableReference] = [] | |||
|
|||
testAction.codeCoverageTargets.forEach { name in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about extracting this into a method:
func testCoverageTargetReferences(...) -> [XCScheme.BuildableReference] {
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @abbasmousavi, this PR is looking great. Besides the comments that I added, I'd add a lint check to make sure that the targets that have test coverage enabled exist in the project. This will be your friend for that.
06d4664
to
87863fb
Compare
Hey @pepibumur, thanks for comments and hints. I have added linting check and a test. |
Thanks for adding those. There are only 2 minor things missing, updating the documentation, which is in the After that we are good to merge this PR. |
@pepibumur, The PR already contains changes to documents and changelog https://github.com/tuist/tuist/blob/1f5df61c5b24b8ae247ced29dbd25f517c7d7a26/CHANGELOG.md |
Sorry, I missed those. All good then @abbasmousavi. I'm mergint the PR... π |
Resolves #618
Short description π
Adds codeCoverageTargets to TestAction
Solution π¦
This property is already implemented in XcodeProj. We only need to assign values to related properties.
Implementation π©βπ»π¨βπ»
It adds
codeCoverageTargets
property to theTestAction
model in manifest and uses it to populatecodeCoverageTargets
andonlyGenerateCoverageForSpecifiedTargets
inXCScheme.TestAction