-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
Add support for junit (successful) test caching. #4771
Conversation
The hacky, though currently standard and ~simple, approach for #4587 |
f145771
to
af2fac4
Compare
Artifacts from successful test runs (junit xml files and coverage reports) are now cached; additionally, multi-target test runs can partially fail and make incremental local progress. This change is in the same spirit as @9bc2ae45 and a future refactor could probably pull up the 1..N target execution caching logic.
af2fac4
to
f8431de
Compare
Ok, this is a go for review. |
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 don't know this code very well, but this change seems great to me!
@@ -62,7 +65,7 @@ def cobertura_jar(**kwargs): | |||
|
|||
register_jvm_tool(register, 'cobertura-report', classpath=[cobertura_jar()]) | |||
|
|||
def __init__(self, settings): | |||
def __init__(self, settings, targets, execute_java_for_targets): |
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.
Some doc on argument type and meaning (particularly execute_java_for_targets
) would be most helpful!
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.
Added.
@@ -294,11 +300,15 @@ def _spawn(self, distribution, executor=None, *args, **kwargs): | |||
executor=actual_executor, | |||
**kwargs) | |||
|
|||
@deprecated(removal_version='1.6.0.dev0', | |||
hint_message='Subclasses should calculate the correct java distribution to use and ' |
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.
Out of curiosity, why not just kill the method? It's not marked as public. Are there known users?
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 re-read http://www.pantsbuild.org/deprecation_policy.html and you're right, I can nuke this. I was thinking we had settled on enclosing scope public implying nested scoped were public as well, but thankfully not!
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.
Killed.
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.
lgtm!
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.
Thanks John!
cache_vts = self._vts_for_partition(invalidation_check) | ||
if invalidation_check.all_vts == invalidation_check.invalid_vts: | ||
# 2.) The full partition was invalid, cache results. | ||
if self.artifact_cache_writes_enabled(): |
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 body of step (2) looks like a good thing to break out as a separate method.
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 - although I kept the same structure as tasks2/PytestRun
, so not a full extraction. The refactor to lift up generic 1..N partition caching will finish this off.
Artifacts from successful test runs (junit xml files and coverage
reports) are now cached; additionally, multi-target test runs can
partially fail and make incremental local progress.
This change is in the same spirit as 9bc2ae4 and a future refactor
could probably pull up the 1..N target execution caching logic.