Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Scoverage work - add scoverage to OSS pants #8064
Scoverage work - add scoverage to OSS pants #8064
Changes from 26 commits
3ef8021
705a12b
5ea8fc5
fc48b64
21a5dd4
2429357
f432d7b
c7f560a
c427e21
324f59d
1a7e8fc
739032a
fc4ed94
3212da7
f9561dc
3d913e3
3209a9f
3cd1b8b
3099ac7
66ace61
3ff84cc
a47ef75
7bacd7b
d9a94e1
37295d6
f390ee4
b15f45d
ae22fed
e5b0a56
12430dd
04065ac
e13edd8
4e1b5c8
02435cc
ed7d4b0
7acd82c
d6a2dbc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
These lines need spaces in them in order to avoid running together.
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.
Pants supports
@file
options natively, so you should make this option a list option:And then someone who wants to put the list of targets in a file (in python list syntax) can pass
--blacklist-targets=@some-blacklist-file
.You could also pass in a (string) list of regexes to match against target names.
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.
It looks like this target is bootstrapped by default. If a user overrides this, the default //:scoverage target is still injected into the build graph.
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.
The blacklist should be cached in-memory, currently the file is read per target.
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.
If you switch this to a list option (as above) that will be handled automatically.
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.
This should probably be at
debug
orinfo
rather thanwarn
.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.
The target itself doesn't need to hold a reference to
_scoverage_instance
: can get it lazily from the singleton.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.
Rather than checking for
.pants.d
, you should useif not self.is_synthetic
. As below, it would be good to do this in the target constructor though.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.
Does doing this in the constructor means checking
kwargs['address'] in kwargs['build_graph'].synthetic_addresses
? I tried that, however, it is still instrumenting those targets. I think what is happening is that the current synthetic target is not added to thebuild_graph.synthetic_addresses
until__init__
is called.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.
There could be better decoupling here rather than checking
if self._scoverage
,possible suggestion could be something similar to: (plugins, may not not need to be passed in but could be a class variable e.g.)
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.
These options should be added to the plugin args in the constructor, rather than here. That would mean that they end up in the payload, and end up in the fingerprint for the target.
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.
Ditto doing this in the constructor.
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.
Is there any reason that this can't be applied for scoverage as well? But also, it's supported by both
jacoco
andcobertura
.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.
No I just modified the comment here because if a user passes JUST
--test-junit-coverage-open
, then coverage is implied but with cobertura as a default - just making this fact explicit. I can change it back if it doesn't help.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 guess it didn't make much sense. Changed it back.
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.
No need to log here I don't think.
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.
IMO, this should just be an error asking someone to set the coverage processor to match. Having multiple flags is confusing, and allowing them to disagree is even more confusing.