7c3f95d1505944f54c998f27f144d4dcb8968477,src/python/twitter/pants/tasks/junit_run.py,JUnitRun,execute,#JUnitRun#Any#,205

Before Change


      tests = list(self.normalize_test_classes() if self.test_classes
                                                 else self.calculate_tests(targets))
      if tests:
        junit_classpath = self.classpath(binary_util.profile_classpath(self.junit_profile,
                            workunit_factory=self.context.new_workunit), confs=self.confs,
                            exclusives_classpath=self.get_base_classpath_for_target(targets[0]))

        def run_tests(classpath, main, jvmargs=None):
          def test_workunit_factory(name, labels=list(), cmd=""):
            return self.context.new_workunit(name=name, labels=[WorkUnit.TEST] + labels, cmd=cmd)

          // TODO(John Sirois): Integrated batching with the test runner.  As things stand we get
          // results summaries for example for each batch but no overall summary.
          // http://jira.local.twitter.com/browse/AWESOME-1114
          result = 0
          for batch in self._partition(tests):
            with binary_util.safe_args(batch) as batch_tests:
              result += abs(binary_util.runjava_indivisible(
                jvmargs=(jvmargs or []) + self.java_args,
                classpath=classpath,
                main=main,
                opts=self.opts,
                args=batch_tests,
                workunit_factory=test_workunit_factory,
                workunit_name="run"
              ))
              if result != 0 and self.fail_fast:
                break
          if result != 0:
            raise TaskError()

        if self.coverage:
          emma_classpath = binary_util.profile_classpath(self.emma_profile)

          def instrument_code():
            safe_mkdir(self.coverage_instrument_dir, clean=True)

After Change


      tests = list(self.normalize_test_classes() if self.test_classes
                                                 else self.calculate_tests(targets))
      if tests:
        bootstrapped_cp = self._bootstrap_utils.get_jvm_build_tools_classpath(self._bootstrap_tools)
        junit_classpath = self.classpath(bootstrapped_cp,
                                         confs=self.confs,
                                         exclusives_classpath=self.get_base_classpath_for_target(targets[0]))

        def run_tests(classpath, main, jvmargs=None):
          def test_workunit_factory(name, labels=list(), cmd=""):
            return self.context.new_workunit(name=name, labels=[WorkUnit.TEST] + labels, cmd=cmd)

          // TODO(John Sirois): Integrated batching with the test runner.  As things stand we get
          // results summaries for example for each batch but no overall summary.
          // http://jira.local.twitter.com/browse/AWESOME-1114
          result = 0
          for batch in self._partition(tests):
            with binary_util.safe_args(batch) as batch_tests:
              result += abs(binary_util.runjava_indivisible(
                jvmargs=(jvmargs or []) + self.java_args,
                classpath=classpath,
                main=main,
                opts=self.opts,
                args=batch_tests,
                workunit_factory=test_workunit_factory,
                workunit_name="run"
              ))
              if result != 0 and self.fail_fast:
                break
          if result != 0:
            raise TaskError()

        if self.coverage:
          emma_classpath = self._bootstrap_utils.get_jvm_build_tools_classpath(self._emma_bootstrap_tools)

          def instrument_code():
            safe_mkdir(self.coverage_instrument_dir, clean=True)
            with binary_util.safe_args(self.get_coverage_patterns(targets)) as patterns:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 10

Instances


Project Name: pantsbuild/pants
Commit Name: 7c3f95d1505944f54c998f27f144d4dcb8968477
Time: 2013-11-25
Author: benjy@foursquare.com
File Name: src/python/twitter/pants/tasks/junit_run.py
Class Name: JUnitRun
Method Name: execute


Project Name: pantsbuild/pants
Commit Name: 7c3f95d1505944f54c998f27f144d4dcb8968477
Time: 2013-11-25
Author: benjy@foursquare.com
File Name: src/python/twitter/pants/tasks/junit_run.py
Class Name: JUnitRun
Method Name: execute


Project Name: pantsbuild/pants
Commit Name: 7c3f95d1505944f54c998f27f144d4dcb8968477
Time: 2013-11-25
Author: benjy@foursquare.com
File Name: src/python/twitter/pants/tasks/benchmark_run.py
Class Name: BenchmarkRun
Method Name: execute


Project Name: pantsbuild/pants
Commit Name: 0ae83e5eea0c5df1423be7c34db26c203d5f51de
Time: 2013-11-07
Author: pl@foursquare.com
File Name: src/python/twitter/pants/tasks/benchmark_run.py
Class Name: BenchmarkRun
Method Name: execute


Project Name: pantsbuild/pants
Commit Name: b9b10a6d778a7f6d3618b41846a44b8d1aec93df
Time: 2013-11-07
Author: pl@foursquare.com
File Name: src/python/twitter/pants/tasks/junit_run.py
Class Name: JUnitRun
Method Name: execute