[test] Remove deprecated FAST_VARIANTS modifier
Bug: v8:7264 Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng Change-Id: I0c07c92955c0b6c145c7b72e5014f828eaf59c9a Reviewed-on: https://chromium-review.googlesource.com/865903 Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org> Commit-Queue: Michael Achenbach <machenbach@chromium.org> Cr-Commit-Position: refs/heads/master@{#50582}
This commit is contained in:
parent
0465c7607a
commit
56fa0a535b
@ -34,27 +34,9 @@ from testrunner.local import testsuite
|
||||
from testrunner.objects import testcase
|
||||
|
||||
|
||||
class LegacyVariantsGenerator(testsuite.LegacyVariantsGenerator):
|
||||
# Both --noopt and --stressopt are very slow. Add TF but without
|
||||
# always opt to match the way the benchmarks are run for performance
|
||||
# testing.
|
||||
def FilterVariantsByTest(self, test):
|
||||
if test.only_standard_variant:
|
||||
return self.standard_variant
|
||||
return self.fast_variants
|
||||
|
||||
def GetFlagSets(self, test, variant):
|
||||
return testsuite.FAST_VARIANT_FLAGS[variant]
|
||||
|
||||
|
||||
class VariantsGenerator(testsuite.VariantsGenerator):
|
||||
def _get_flags_set(self, test):
|
||||
return testsuite.FAST_VARIANT_FLAGS
|
||||
|
||||
def _get_variants(self, test):
|
||||
if test.only_standard_variant:
|
||||
return self._standard_variant
|
||||
return self._fast_variants
|
||||
return self._standard_variant
|
||||
|
||||
|
||||
class TestSuite(testsuite.TestSuite):
|
||||
@ -131,7 +113,7 @@ class TestSuite(testsuite.TestSuite):
|
||||
return VariantsGenerator
|
||||
|
||||
def _LegacyVariantsGeneratorFactory(self):
|
||||
return LegacyVariantsGenerator
|
||||
return testsuite.StandardLegacyVariantsGenerator
|
||||
|
||||
|
||||
class TestCase(testcase.TestCase):
|
||||
|
@ -8,19 +8,7 @@ from testrunner.local import testsuite
|
||||
from testrunner.objects import testcase
|
||||
|
||||
|
||||
class LegacyVariantsGenerator(testsuite.LegacyVariantsGenerator):
|
||||
# Only run the fuzzer with standard variant.
|
||||
def FilterVariantsByTest(self, test):
|
||||
return self.standard_variant
|
||||
|
||||
def GetFlagSets(self, test, variant):
|
||||
return testsuite.FAST_VARIANT_FLAGS[variant]
|
||||
|
||||
|
||||
class VariantsGenerator(testsuite.VariantsGenerator):
|
||||
def _get_flags_set(self, test):
|
||||
return testsuite.FAST_VARIANT_FLAGS
|
||||
|
||||
def _get_variants(self, test):
|
||||
return self._standard_variant
|
||||
|
||||
@ -50,7 +38,7 @@ class TestSuite(testsuite.TestSuite):
|
||||
return VariantsGenerator
|
||||
|
||||
def _LegacyVariantsGeneratorFactory(self):
|
||||
return LegacyVariantsGenerator
|
||||
return testsuite.StandardLegacyVariantsGenerator
|
||||
|
||||
|
||||
class TestCase(testcase.TestCase):
|
||||
|
@ -75,48 +75,26 @@ ALL_VARIANT_FLAGS_STRICT = dict(
|
||||
for v, flag_sets in testsuite.ALL_VARIANT_FLAGS.iteritems()
|
||||
)
|
||||
|
||||
FAST_VARIANT_FLAGS_STRICT = dict(
|
||||
(v, [flags + ["--use-strict"] for flags in flag_sets])
|
||||
for v, flag_sets in testsuite.FAST_VARIANT_FLAGS.iteritems()
|
||||
)
|
||||
|
||||
ALL_VARIANT_FLAGS_BOTH = dict(
|
||||
(v, [flags for flags in testsuite.ALL_VARIANT_FLAGS[v] +
|
||||
ALL_VARIANT_FLAGS_STRICT[v]])
|
||||
for v in testsuite.ALL_VARIANT_FLAGS
|
||||
)
|
||||
|
||||
FAST_VARIANT_FLAGS_BOTH = dict(
|
||||
(v, [flags for flags in testsuite.FAST_VARIANT_FLAGS[v] +
|
||||
FAST_VARIANT_FLAGS_STRICT[v]])
|
||||
for v in testsuite.FAST_VARIANT_FLAGS
|
||||
)
|
||||
|
||||
ALL_VARIANTS = {
|
||||
'nostrict': testsuite.ALL_VARIANT_FLAGS,
|
||||
'strict': ALL_VARIANT_FLAGS_STRICT,
|
||||
'both': ALL_VARIANT_FLAGS_BOTH,
|
||||
}
|
||||
|
||||
FAST_VARIANTS = {
|
||||
'nostrict': testsuite.FAST_VARIANT_FLAGS,
|
||||
'strict': FAST_VARIANT_FLAGS_STRICT,
|
||||
'both': FAST_VARIANT_FLAGS_BOTH,
|
||||
}
|
||||
|
||||
class LegacyVariantsGenerator(testsuite.LegacyVariantsGenerator):
|
||||
def GetFlagSets(self, test, variant):
|
||||
if test.only_fast_variants:
|
||||
variant_flags = FAST_VARIANTS
|
||||
else:
|
||||
variant_flags = ALL_VARIANTS
|
||||
|
||||
test_record = test.test_record
|
||||
if "noStrict" in test_record:
|
||||
return variant_flags["nostrict"][variant]
|
||||
return ALL_VARIANTS["nostrict"][variant]
|
||||
if "onlyStrict" in test_record:
|
||||
return variant_flags["strict"][variant]
|
||||
return variant_flags["both"][variant]
|
||||
return ALL_VARIANTS["strict"][variant]
|
||||
return ALL_VARIANTS["both"][variant]
|
||||
|
||||
|
||||
class VariantsGenerator(testsuite.VariantsGenerator):
|
||||
@ -134,8 +112,6 @@ class VariantsGenerator(testsuite.VariantsGenerator):
|
||||
yield (variant, flags + ['--use-strict'], 'strict-%d' % n)
|
||||
|
||||
def _get_flags_set(self, test):
|
||||
if test.only_fast_variants:
|
||||
return testsuite.FAST_VARIANTS_FLAGS
|
||||
return testsuite.ALL_VARIANT_FLAGS
|
||||
|
||||
|
||||
|
@ -44,14 +44,13 @@ FAIL_SLOPPY = "FAIL_SLOPPY"
|
||||
# Modifiers
|
||||
SKIP = "SKIP"
|
||||
SLOW = "SLOW"
|
||||
FAST_VARIANTS = "FAST_VARIANTS"
|
||||
NO_VARIANTS = "NO_VARIANTS"
|
||||
|
||||
ALWAYS = "ALWAYS"
|
||||
|
||||
KEYWORDS = {}
|
||||
for key in [SKIP, FAIL, PASS, CRASH, SLOW, FAIL_OK, FAST_VARIANTS, NO_VARIANTS,
|
||||
FAIL_SLOPPY, ALWAYS]:
|
||||
for key in [SKIP, FAIL, PASS, CRASH, SLOW, FAIL_OK, NO_VARIANTS, FAIL_SLOPPY,
|
||||
ALWAYS]:
|
||||
KEYWORDS[key] = key
|
||||
|
||||
# Support arches, modes to be written as keywords instead of strings.
|
||||
|
@ -34,10 +34,9 @@ from . import command
|
||||
from . import statusfile
|
||||
from . import utils
|
||||
from ..objects.testcase import TestCase
|
||||
from variants import ALL_VARIANTS, ALL_VARIANT_FLAGS, FAST_VARIANT_FLAGS
|
||||
from variants import ALL_VARIANTS, ALL_VARIANT_FLAGS
|
||||
|
||||
|
||||
FAST_VARIANTS = set(["default", "turbofan"])
|
||||
STANDARD_VARIANT = set(["default"])
|
||||
|
||||
|
||||
@ -45,21 +44,15 @@ class LegacyVariantsGenerator(object):
|
||||
def __init__(self, suite, variants):
|
||||
self.suite = suite
|
||||
self.all_variants = ALL_VARIANTS & variants
|
||||
self.fast_variants = FAST_VARIANTS & variants
|
||||
self.standard_variant = STANDARD_VARIANT & variants
|
||||
|
||||
def FilterVariantsByTest(self, test):
|
||||
if test.only_standard_variant:
|
||||
return self.standard_variant
|
||||
if test.only_fast_variants:
|
||||
return self.fast_variants
|
||||
return self.all_variants
|
||||
|
||||
def GetFlagSets(self, test, variant):
|
||||
if test.only_fast_variants:
|
||||
return FAST_VARIANT_FLAGS[variant]
|
||||
else:
|
||||
return ALL_VARIANT_FLAGS[variant]
|
||||
return ALL_VARIANT_FLAGS[variant]
|
||||
|
||||
|
||||
class StandardLegacyVariantsGenerator(LegacyVariantsGenerator):
|
||||
@ -70,7 +63,6 @@ class StandardLegacyVariantsGenerator(LegacyVariantsGenerator):
|
||||
class VariantsGenerator(object):
|
||||
def __init__(self, variants):
|
||||
self._all_variants = [v for v in variants if v in ALL_VARIANTS]
|
||||
self._fast_variants = [v for v in variants if v in FAST_VARIANTS]
|
||||
self._standard_variant = [v for v in variants if v in STANDARD_VARIANT]
|
||||
|
||||
def gen(self, test):
|
||||
@ -80,16 +72,11 @@ class VariantsGenerator(object):
|
||||
yield (variant, flags_set[variant][0], n)
|
||||
|
||||
def _get_flags_set(self, test):
|
||||
if test.only_fast_variants:
|
||||
return FAST_VARIANT_FLAGS
|
||||
else:
|
||||
return ALL_VARIANT_FLAGS
|
||||
return ALL_VARIANT_FLAGS
|
||||
|
||||
def _get_variants(self, test):
|
||||
if test.only_standard_variant:
|
||||
return self._standard_variant
|
||||
if test.only_fast_variants:
|
||||
return self._fast_variants
|
||||
return self._all_variants
|
||||
|
||||
|
||||
|
@ -25,10 +25,4 @@ ALL_VARIANT_FLAGS = {
|
||||
"infra_staging": [[]],
|
||||
}
|
||||
|
||||
# FAST_VARIANTS implies no --always-opt.
|
||||
FAST_VARIANT_FLAGS = dict(
|
||||
(k, [[f for f in v[0] if f != "--always-opt"]])
|
||||
for k, v in ALL_VARIANT_FLAGS.iteritems()
|
||||
)
|
||||
|
||||
ALL_VARIANTS = set(ALL_VARIANT_FLAGS.keys())
|
||||
|
@ -157,10 +157,6 @@ class TestCase(object):
|
||||
def only_standard_variant(self):
|
||||
return statusfile.NO_VARIANTS in self._statusfile_outcomes
|
||||
|
||||
@property
|
||||
def only_fast_variants(self):
|
||||
return statusfile.FAST_VARIANTS in self._statusfile_outcomes
|
||||
|
||||
def get_command(self, context):
|
||||
params = self._get_cmd_params(context)
|
||||
env = self._get_cmd_env()
|
||||
|
@ -3,11 +3,10 @@
|
||||
# found in the LICENSE file.
|
||||
|
||||
from . import base
|
||||
from ..local.variants import ALL_VARIANTS, ALL_VARIANT_FLAGS, FAST_VARIANT_FLAGS
|
||||
from ..local.variants import ALL_VARIANTS, ALL_VARIANT_FLAGS
|
||||
from .result import GroupedResult
|
||||
|
||||
|
||||
FAST_VARIANTS = set(["default", "turbofan"])
|
||||
STANDARD_VARIANT = set(["default"])
|
||||
|
||||
|
||||
|
@ -506,8 +506,7 @@ class SystemTest(unittest.TestCase):
|
||||
self.assertEqual(1, result.returncode, result)
|
||||
|
||||
def testSpecificVariants(self):
|
||||
"""Test using NO_VARIANTS and FAST_VARIANTS modifiers in status files skips
|
||||
the desire tests.
|
||||
"""Test using NO_VARIANTS modifiers in status files skips the desire tests.
|
||||
|
||||
The test runner cmd line configures 4 tests to run (2 tests * 2 variants).
|
||||
But the status file applies a modifier to each skipping one of the
|
||||
|
@ -30,6 +30,6 @@
|
||||
|
||||
['no_snap', {
|
||||
'bananas': [PASS, NO_VARIANTS],
|
||||
'raspberries': [FAIL, FAST_VARIANTS],
|
||||
'raspberries': [FAIL, NO_VARIANTS],
|
||||
}],
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user