Spaces Data

Minimal test - lines (292, 329)

path: .spaces[5].spaces[4].metrics.mi.mi_sei
old: 87.00845565324984
new: 86.61071155926786

path: .spaces[5].spaces[4].metrics.mi.mi_original
old: 80.5569480636239
new: 80.12492246089289

path: .spaces[5].spaces[4].metrics.mi.mi_visual_studio
old: 47.10932635299643
new: 46.85667980169175

path: .spaces[5].spaces[4].metrics.loc.sloc
old: 37.0
new: 38.0

path: .spaces[5].spaces[4].metrics.loc.cloc
old: 21.0
new: 22.0

Code

  def RunAndVerifyWithSharding(self, gtest_filter, total_shards, tests_to_run,
                               args=None, check_exit_0=False):
    """Checks that binary runs correct tests for the given filter and shard.

    Runs all shards of googletest-filter-unittest_ with the given filter, and
    verifies that the right set of tests were run. The union of tests run
    on each shard should be identical to tests_to_run, without duplicates.
    If check_exit_0, .

    Args:
      gtest_filter: A filter to apply to the tests.
      total_shards: A total number of shards to split test run into.
      tests_to_run: A set of tests expected to run.
      args   :      Arguments to pass to the to the test binary.
      check_exit_0: When set to a true value, make sure that all shards
                    return 0.
    """

    tests_to_run = self.AdjustForParameterizedTests(tests_to_run)

    # Windows removes empty variables from the environment when passing it
    # to a new process.  This means it is impossible to pass an empty filter
    # into a process using the environment variable.  However, we can still
    # test the case when the variable is not supplied (i.e., gtest_filter is
    # None).
    # pylint: disable-msg=C6403
    if CAN_TEST_EMPTY_FILTER or gtest_filter != '':
      SetEnvVar(FILTER_ENV_VAR, gtest_filter)
      partition = []
      for i in range(0, total_shards):
        (tests_run, exit_code) = RunWithSharding(total_shards, i, args)
        if check_exit_0:
          self.assertEqual(0, exit_code)
        partition.append(tests_run)

      self.AssertPartitionIsValid(tests_to_run, partition)
      SetEnvVar(FILTER_ENV_VAR, None)
    # pylint: enable-msg=C6403