Commit 436fcaa0 authored by Sam Clegg's avatar Sam Clegg Committed by Commit Bot

Fix some python nits in tools/testrunner/standard_runner.py

I noticed the indentation was off in one function, but also fixed
all the other flake8 issues in this file.

Change-Id: I2303ed87da7154484a872315f8355f57621514c4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1697054Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Sam Clegg <sbc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62669}
parent 0461a2ac
...@@ -9,7 +9,6 @@ from __future__ import print_function ...@@ -9,7 +9,6 @@ from __future__ import print_function
from functools import reduce from functools import reduce
import os import os
import re
import sys import sys
# Adds testrunner to the path hence it has to be imported at the beggining. # Adds testrunner to the path hence it has to be imported at the beggining.
...@@ -21,10 +20,8 @@ from testrunner.objects import predictable ...@@ -21,10 +20,8 @@ from testrunner.objects import predictable
from testrunner.testproc.execution import ExecutionProc from testrunner.testproc.execution import ExecutionProc
from testrunner.testproc.filter import StatusFileFilterProc, NameFilterProc from testrunner.testproc.filter import StatusFileFilterProc, NameFilterProc
from testrunner.testproc.loader import LoadProc from testrunner.testproc.loader import LoadProc
from testrunner.testproc.progress import ResultsTracker
from testrunner.testproc.seed import SeedProc from testrunner.testproc.seed import SeedProc
from testrunner.testproc.variant import VariantProc from testrunner.testproc.variant import VariantProc
from testrunner.utils import random_utils
ARCH_GUESS = utils.DefaultArch() ARCH_GUESS = utils.DefaultArch()
...@@ -43,7 +40,7 @@ VARIANT_ALIASES = { ...@@ -43,7 +40,7 @@ VARIANT_ALIASES = {
'dev': VARIANTS, 'dev': VARIANTS,
# Additional variants, run on all bots. # Additional variants, run on all bots.
'more': MORE_VARIANTS, 'more': MORE_VARIANTS,
# Shortcut for the two above ('more' first - it has the longer running tests). # Shortcut for the two above ('more' first - it has the longer running tests)
'exhaustive': MORE_VARIANTS + VARIANTS, 'exhaustive': MORE_VARIANTS + VARIANTS,
# Additional variants, run on a subset of bots. # Additional variants, run on a subset of bots.
'extra': ['nooptimization', 'future', 'no_wasm_traps'], 'extra': ['nooptimization', 'future', 'no_wasm_traps'],
...@@ -66,10 +63,10 @@ PREDICTABLE_WRAPPER = os.path.join( ...@@ -66,10 +63,10 @@ PREDICTABLE_WRAPPER = os.path.join(
class StandardTestRunner(base_runner.BaseTestRunner): class StandardTestRunner(base_runner.BaseTestRunner):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(StandardTestRunner, self).__init__(*args, **kwargs) super(StandardTestRunner, self).__init__(*args, **kwargs)
self.sancov_dir = None self.sancov_dir = None
self._variants = None self._variants = None
@property @property
def framework_name(self): def framework_name(self):
...@@ -156,7 +153,6 @@ class StandardTestRunner(base_runner.BaseTestRunner): ...@@ -156,7 +153,6 @@ class StandardTestRunner(base_runner.BaseTestRunner):
parser.add_option('--report', default=False, action='store_true', parser.add_option('--report', default=False, action='store_true',
help='Print a summary of the tests to be run') help='Print a summary of the tests to be run')
def _process_options(self, options): def _process_options(self, options):
if options.sancov_dir: if options.sancov_dir:
self.sancov_dir = options.sancov_dir self.sancov_dir = options.sancov_dir
...@@ -224,7 +220,7 @@ class StandardTestRunner(base_runner.BaseTestRunner): ...@@ -224,7 +220,7 @@ class StandardTestRunner(base_runner.BaseTestRunner):
self._variants = self._parse_variants(options.variants) self._variants = self._parse_variants(options.variants)
def CheckTestMode(name, option): # pragma: no cover def CheckTestMode(name, option): # pragma: no cover
if not option in ['run', 'skip', 'dontcare']: if option not in ['run', 'skip', 'dontcare']:
print('Unknown %s mode %s' % (name, option)) print('Unknown %s mode %s' % (name, option))
raise base_runner.TestRunnerError() raise base_runner.TestRunnerError()
CheckTestMode('slow test', options.slow_tests) CheckTestMode('slow test', options.slow_tests)
...@@ -319,7 +315,7 @@ class StandardTestRunner(base_runner.BaseTestRunner): ...@@ -319,7 +315,7 @@ class StandardTestRunner(base_runner.BaseTestRunner):
self._prepare_procs(procs) self._prepare_procs(procs)
loader.load_initial_tests(initial_batch_size=options.j*2) loader.load_initial_tests(initial_batch_size=options.j * 2)
# This starts up worker processes and blocks until all tests are # This starts up worker processes and blocks until all tests are
# processed. # processed.
...@@ -328,7 +324,6 @@ class StandardTestRunner(base_runner.BaseTestRunner): ...@@ -328,7 +324,6 @@ class StandardTestRunner(base_runner.BaseTestRunner):
for indicator in indicators: for indicator in indicators:
indicator.finished() indicator.finished()
if tests.test_count_estimate: if tests.test_count_estimate:
percentage = float(results.total) / tests.test_count_estimate * 100 percentage = float(results.total) / tests.test_count_estimate * 100
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment