Commit 56fa0a53 authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[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/865903Reviewed-by: 's avatarSergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50582}
parent 0465c760
...@@ -34,27 +34,9 @@ from testrunner.local import testsuite ...@@ -34,27 +34,9 @@ from testrunner.local import testsuite
from testrunner.objects import testcase 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): class VariantsGenerator(testsuite.VariantsGenerator):
def _get_flags_set(self, test):
return testsuite.FAST_VARIANT_FLAGS
def _get_variants(self, test): def _get_variants(self, test):
if test.only_standard_variant: return self._standard_variant
return self._standard_variant
return self._fast_variants
class TestSuite(testsuite.TestSuite): class TestSuite(testsuite.TestSuite):
...@@ -131,7 +113,7 @@ class TestSuite(testsuite.TestSuite): ...@@ -131,7 +113,7 @@ class TestSuite(testsuite.TestSuite):
return VariantsGenerator return VariantsGenerator
def _LegacyVariantsGeneratorFactory(self): def _LegacyVariantsGeneratorFactory(self):
return LegacyVariantsGenerator return testsuite.StandardLegacyVariantsGenerator
class TestCase(testcase.TestCase): class TestCase(testcase.TestCase):
......
...@@ -8,19 +8,7 @@ from testrunner.local import testsuite ...@@ -8,19 +8,7 @@ from testrunner.local import testsuite
from testrunner.objects import testcase 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): class VariantsGenerator(testsuite.VariantsGenerator):
def _get_flags_set(self, test):
return testsuite.FAST_VARIANT_FLAGS
def _get_variants(self, test): def _get_variants(self, test):
return self._standard_variant return self._standard_variant
...@@ -50,7 +38,7 @@ class TestSuite(testsuite.TestSuite): ...@@ -50,7 +38,7 @@ class TestSuite(testsuite.TestSuite):
return VariantsGenerator return VariantsGenerator
def _LegacyVariantsGeneratorFactory(self): def _LegacyVariantsGeneratorFactory(self):
return LegacyVariantsGenerator return testsuite.StandardLegacyVariantsGenerator
class TestCase(testcase.TestCase): class TestCase(testcase.TestCase):
......
...@@ -75,48 +75,26 @@ ALL_VARIANT_FLAGS_STRICT = dict( ...@@ -75,48 +75,26 @@ ALL_VARIANT_FLAGS_STRICT = dict(
for v, flag_sets in testsuite.ALL_VARIANT_FLAGS.iteritems() 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( ALL_VARIANT_FLAGS_BOTH = dict(
(v, [flags for flags in testsuite.ALL_VARIANT_FLAGS[v] + (v, [flags for flags in testsuite.ALL_VARIANT_FLAGS[v] +
ALL_VARIANT_FLAGS_STRICT[v]]) ALL_VARIANT_FLAGS_STRICT[v]])
for v in testsuite.ALL_VARIANT_FLAGS 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 = { ALL_VARIANTS = {
'nostrict': testsuite.ALL_VARIANT_FLAGS, 'nostrict': testsuite.ALL_VARIANT_FLAGS,
'strict': ALL_VARIANT_FLAGS_STRICT, 'strict': ALL_VARIANT_FLAGS_STRICT,
'both': ALL_VARIANT_FLAGS_BOTH, '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): class LegacyVariantsGenerator(testsuite.LegacyVariantsGenerator):
def GetFlagSets(self, test, variant): def GetFlagSets(self, test, variant):
if test.only_fast_variants:
variant_flags = FAST_VARIANTS
else:
variant_flags = ALL_VARIANTS
test_record = test.test_record test_record = test.test_record
if "noStrict" in test_record: if "noStrict" in test_record:
return variant_flags["nostrict"][variant] return ALL_VARIANTS["nostrict"][variant]
if "onlyStrict" in test_record: if "onlyStrict" in test_record:
return variant_flags["strict"][variant] return ALL_VARIANTS["strict"][variant]
return variant_flags["both"][variant] return ALL_VARIANTS["both"][variant]
class VariantsGenerator(testsuite.VariantsGenerator): class VariantsGenerator(testsuite.VariantsGenerator):
...@@ -134,8 +112,6 @@ class VariantsGenerator(testsuite.VariantsGenerator): ...@@ -134,8 +112,6 @@ class VariantsGenerator(testsuite.VariantsGenerator):
yield (variant, flags + ['--use-strict'], 'strict-%d' % n) yield (variant, flags + ['--use-strict'], 'strict-%d' % n)
def _get_flags_set(self, test): def _get_flags_set(self, test):
if test.only_fast_variants:
return testsuite.FAST_VARIANTS_FLAGS
return testsuite.ALL_VARIANT_FLAGS return testsuite.ALL_VARIANT_FLAGS
......
...@@ -44,14 +44,13 @@ FAIL_SLOPPY = "FAIL_SLOPPY" ...@@ -44,14 +44,13 @@ FAIL_SLOPPY = "FAIL_SLOPPY"
# Modifiers # Modifiers
SKIP = "SKIP" SKIP = "SKIP"
SLOW = "SLOW" SLOW = "SLOW"
FAST_VARIANTS = "FAST_VARIANTS"
NO_VARIANTS = "NO_VARIANTS" NO_VARIANTS = "NO_VARIANTS"
ALWAYS = "ALWAYS" ALWAYS = "ALWAYS"
KEYWORDS = {} KEYWORDS = {}
for key in [SKIP, FAIL, PASS, CRASH, SLOW, FAIL_OK, FAST_VARIANTS, NO_VARIANTS, for key in [SKIP, FAIL, PASS, CRASH, SLOW, FAIL_OK, NO_VARIANTS, FAIL_SLOPPY,
FAIL_SLOPPY, ALWAYS]: ALWAYS]:
KEYWORDS[key] = key KEYWORDS[key] = key
# Support arches, modes to be written as keywords instead of strings. # Support arches, modes to be written as keywords instead of strings.
......
...@@ -34,10 +34,9 @@ from . import command ...@@ -34,10 +34,9 @@ from . import command
from . import statusfile from . import statusfile
from . import utils from . import utils
from ..objects.testcase import TestCase 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"]) STANDARD_VARIANT = set(["default"])
...@@ -45,21 +44,15 @@ class LegacyVariantsGenerator(object): ...@@ -45,21 +44,15 @@ class LegacyVariantsGenerator(object):
def __init__(self, suite, variants): def __init__(self, suite, variants):
self.suite = suite self.suite = suite
self.all_variants = ALL_VARIANTS & variants self.all_variants = ALL_VARIANTS & variants
self.fast_variants = FAST_VARIANTS & variants
self.standard_variant = STANDARD_VARIANT & variants self.standard_variant = STANDARD_VARIANT & variants
def FilterVariantsByTest(self, test): def FilterVariantsByTest(self, test):
if test.only_standard_variant: if test.only_standard_variant:
return self.standard_variant return self.standard_variant
if test.only_fast_variants:
return self.fast_variants
return self.all_variants return self.all_variants
def GetFlagSets(self, test, variant): def GetFlagSets(self, test, variant):
if test.only_fast_variants: return ALL_VARIANT_FLAGS[variant]
return FAST_VARIANT_FLAGS[variant]
else:
return ALL_VARIANT_FLAGS[variant]
class StandardLegacyVariantsGenerator(LegacyVariantsGenerator): class StandardLegacyVariantsGenerator(LegacyVariantsGenerator):
...@@ -70,7 +63,6 @@ class StandardLegacyVariantsGenerator(LegacyVariantsGenerator): ...@@ -70,7 +63,6 @@ class StandardLegacyVariantsGenerator(LegacyVariantsGenerator):
class VariantsGenerator(object): class VariantsGenerator(object):
def __init__(self, variants): def __init__(self, variants):
self._all_variants = [v for v in variants if v in ALL_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] self._standard_variant = [v for v in variants if v in STANDARD_VARIANT]
def gen(self, test): def gen(self, test):
...@@ -80,16 +72,11 @@ class VariantsGenerator(object): ...@@ -80,16 +72,11 @@ class VariantsGenerator(object):
yield (variant, flags_set[variant][0], n) yield (variant, flags_set[variant][0], n)
def _get_flags_set(self, test): def _get_flags_set(self, test):
if test.only_fast_variants: return ALL_VARIANT_FLAGS
return FAST_VARIANT_FLAGS
else:
return ALL_VARIANT_FLAGS
def _get_variants(self, test): def _get_variants(self, test):
if test.only_standard_variant: if test.only_standard_variant:
return self._standard_variant return self._standard_variant
if test.only_fast_variants:
return self._fast_variants
return self._all_variants return self._all_variants
......
...@@ -25,10 +25,4 @@ ALL_VARIANT_FLAGS = { ...@@ -25,10 +25,4 @@ ALL_VARIANT_FLAGS = {
"infra_staging": [[]], "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()) ALL_VARIANTS = set(ALL_VARIANT_FLAGS.keys())
...@@ -157,10 +157,6 @@ class TestCase(object): ...@@ -157,10 +157,6 @@ class TestCase(object):
def only_standard_variant(self): def only_standard_variant(self):
return statusfile.NO_VARIANTS in self._statusfile_outcomes 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): def get_command(self, context):
params = self._get_cmd_params(context) params = self._get_cmd_params(context)
env = self._get_cmd_env() env = self._get_cmd_env()
......
...@@ -3,11 +3,10 @@ ...@@ -3,11 +3,10 @@
# found in the LICENSE file. # found in the LICENSE file.
from . import base 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 from .result import GroupedResult
FAST_VARIANTS = set(["default", "turbofan"])
STANDARD_VARIANT = set(["default"]) STANDARD_VARIANT = set(["default"])
......
...@@ -506,8 +506,7 @@ class SystemTest(unittest.TestCase): ...@@ -506,8 +506,7 @@ class SystemTest(unittest.TestCase):
self.assertEqual(1, result.returncode, result) self.assertEqual(1, result.returncode, result)
def testSpecificVariants(self): def testSpecificVariants(self):
"""Test using NO_VARIANTS and FAST_VARIANTS modifiers in status files skips """Test using NO_VARIANTS modifiers in status files skips the desire tests.
the desire tests.
The test runner cmd line configures 4 tests to run (2 tests * 2 variants). 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 But the status file applies a modifier to each skipping one of the
......
...@@ -30,6 +30,6 @@ ...@@ -30,6 +30,6 @@
['no_snap', { ['no_snap', {
'bananas': [PASS, NO_VARIANTS], 'bananas': [PASS, NO_VARIANTS],
'raspberries': [FAIL, FAST_VARIANTS], 'raspberries': [FAIL, NO_VARIANTS],
}], }],
] ]
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