Reason for revert:
[Sheriff] Revert until the tree is in a better state.
Original issue's description:
> [test] Refactoring - Let runner handle test IDs.
>
> This prepares for properly rerunning tests. Currently when
> tests are rerun, the same test object is reused. This
> will be changed in a follow up.
>
> Committed: https://crrev.com/
f41a81b8a513fc360c500c066b74f223bc9c0223
> Cr-Commit-Position: refs/heads/master@{#28864}
TBR=jkummerow@chromium.org,tandrii@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/
1167343003
Cr-Commit-Position: refs/heads/master@{#28891}
}
all_tests = []
num_tests = 0
+ test_id = 0
for s in suites:
s.ReadStatusFile(variables)
s.ReadTestCases(ctx)
for v in s.VariantFlags(t, variant_flags) ]
s.tests = ShardTests(s.tests, options.shard_count, options.shard_run)
num_tests += len(s.tests)
+ for t in s.tests:
+ t.id = test_id
+ test_id += 1
if options.cat:
return 0 # We're done here.
for t in self.tests:
t.duration = self.perfdata.FetchPerfData(t) or 1.0
self.tests.sort(key=lambda t: t.duration, reverse=True)
- self._CommonInit(suites, progress_indicator, context)
+ self._CommonInit(len(self.tests), progress_indicator, context)
- def _CommonInit(self, suites, progress_indicator, context):
- self.total = 0
- for s in suites:
- for t in s.tests:
- t.id = self.total
- self.total += 1
+ def _CommonInit(self, num_tests, progress_indicator, context):
self.indicator = progress_indicator
progress_indicator.runner = self
self.context = context
self.succeeded = 0
- self.remaining = self.total
+ self.total = num_tests
+ self.remaining = num_tests
self.failed = []
self.crashed = 0
self.reran_tests = 0
test.run += 1
pool.add([self._GetJob(test)])
self.remaining += 1
- self.total += 1
def _ProcessTestNormal(self, test, result, pool):
self.indicator.AboutToRun(test)
class NetworkedRunner(execution.Runner):
def __init__(self, suites, progress_indicator, context, peers, workspace):
self.suites = suites
+ num_tests = 0
datapath = os.path.join("out", "testrunner_data")
# TODO(machenbach): These fields should exist now in the superclass.
# But there is no super constructor call. Check if this is a problem.
for s in suites:
for t in s.tests:
t.duration = self.perfdata.FetchPerfData(t) or 1.0
- self._CommonInit(suites, progress_indicator, context)
+ num_tests += len(s.tests)
+ self._CommonInit(num_tests, progress_indicator, context)
self.tests = [] # Only used if we need to fall back to local execution.
self.tests_lock = threading.Lock()
self.peers = peers