diff --git a/src/python/pants/backend/jvm/tasks/junit_run.py b/src/python/pants/backend/jvm/tasks/junit_run.py index 964035da535..9050dc0c923 100644 --- a/src/python/pants/backend/jvm/tasks/junit_run.py +++ b/src/python/pants/backend/jvm/tasks/junit_run.py @@ -26,7 +26,6 @@ from pants.util.dirutil import safe_mkdir, safe_open - # TODO(ji): Add unit tests. # TODO(ji): Add coverage in ci.run (https://github.com/pantsbuild/pants/issues/83) @@ -161,6 +160,9 @@ def __init__(self, task_exports, context): self._opts.extend(context.options.junit_run_arg) def execute(self, targets): + # filter out non-junit-test targets + targets = list(self._test_target_candidates(targets)) + tests = list(self._get_tests_to_run() if self._tests_to_run else self._calculate_tests_from_targets(targets)) if tests: