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

Add support for junit (successful) test caching. #4771

Merged
merged 2 commits into from
Aug 2, 2017

Conversation

jsirois
Copy link
Contributor

@jsirois jsirois commented Jul 25, 2017

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.

@jsirois jsirois changed the title Initial cut at junit (successful) test caching. Implement junit (successful) test result caching. Jul 25, 2017
@jsirois
Copy link
Contributor Author

jsirois commented Jul 25, 2017

The hacky, though currently standard and ~simple, approach for #4587

@jsirois jsirois force-pushed the jsirois/issues/4587/junit branch 4 times, most recently from f145771 to af2fac4 Compare July 30, 2017 20:15
@jsirois jsirois changed the title Implement junit (successful) test result caching. Add support for junit (successful) test caching. Jul 30, 2017
@jsirois jsirois requested review from benjyw, stuhood and ity and removed request for benjyw, stuhood and ity July 30, 2017 20:17
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.
@jsirois jsirois force-pushed the jsirois/issues/4587/junit branch from af2fac4 to f8431de Compare August 1, 2017 19:56
@jsirois jsirois requested review from benjyw, ity and stuhood August 1, 2017 20:35
@jsirois
Copy link
Contributor Author

jsirois commented Aug 1, 2017

Ok, this is a go for review.

Copy link
Contributor

@benjyw benjyw left a 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):
Copy link
Contributor

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!

Copy link
Contributor Author

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 '
Copy link
Contributor

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?

Copy link
Contributor Author

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!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Killed.

Copy link
Contributor

@ity ity left a comment

Choose a reason for hiding this comment

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

lgtm!

Copy link
Member

@stuhood stuhood left a 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():
Copy link
Member

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.

Copy link
Contributor Author

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.

@jsirois jsirois merged commit dbf79e6 into pantsbuild:master Aug 2, 2017
@jsirois jsirois deleted the jsirois/issues/4587/junit branch August 2, 2017 06:30
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.

4 participants