Skip to content

Commit

Permalink
Clean up unused test filter 'config' (#2702)
Browse files Browse the repository at this point in the history
We only run tests on CI in 'devel' config, so removing filters in
'debug' mode is a no-op.

b/150410605
  • Loading branch information
kaidokert authored Mar 25, 2024
2 parents 60884cb + 77b8960 commit 826241f
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 38 deletions.
2 changes: 0 additions & 2 deletions cobalt/black_box_tests/tests/web_platform_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ def test_web_platform(self):
if filter_ == test_filter.FILTER_ALL:
return
if isinstance(filter_, test_filter.TestFilter):
if filter_.config and filter_.config != self.launcher_params.config:
continue
if filter_.test_name and filter_.test_name == test_filter.FILTER_ALL:
return
used_filters.append(filter_.test_name)
Expand Down
5 changes: 0 additions & 5 deletions starboard/evergreen/arm/shared/cobalt/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ def __init__( # pylint:disable=useless-super-delegation

def GetTestFilters(self):
filters = super().GetTestFilters()
filters.extend([
# TODO: Remove this filter once the layout_tests slowdown in the debug
# configuration is resolved.
test_filter.TestFilter('layout_tests', test_filter.FILTER_ALL, 'debug'),
])
for target, tests in self.__FILTERED_TESTS.items():
filters.extend(test_filter.TestFilter(target, test) for test in tests)
return filters
Expand Down
4 changes: 0 additions & 4 deletions starboard/evergreen/arm/shared/gyp_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,3 @@ def __init__(self, platform):
super().__init__(platform)

self.AppendApplicationConfigurationPath(os.path.dirname(__file__))


def CreatePlatformConfig():
return EvergreenArmConfiguration('evergreen-arm')
10 changes: 1 addition & 9 deletions starboard/linux/shared/cobalt/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,7 @@ def GetWebPlatformTestFilters(self):
# These tests are timing-sensitive, and are thus flaky on slower builds
test_filter.TestFilter(
'web_platform_tests',
'xhr/WebPlatformTest.Run/XMLHttpRequest_send_timeout_events_htm',
'debug'),
test_filter.TestFilter(
'web_platform_tests',
'streams/WebPlatformTest.Run/streams_readable_streams_templated_html', # pylint:disable=line-too-long
'debug'),
test_filter.TestFilter(
'web_platform_tests',
'cors/WebPlatformTest.Run/cors_preflight_failure_htm', 'devel')
'cors/WebPlatformTest.Run/cors_preflight_failure_htm')
])
return filters

Expand Down
3 changes: 0 additions & 3 deletions starboard/raspi/shared/cobalt/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ class CobaltRaspiConfiguration(cobalt_configuration.CobaltConfiguration):
def GetTestFilters(self):
filters = super().GetTestFilters()
filters.extend([
# TODO: Remove this filter once the layout_tests slowdown in the debug
# configuration is resolved.
test_filter.TestFilter('layout_tests', test_filter.FILTER_ALL, 'debug'),
# These tests are currently producing slightly different images on the
# RasPi.
test_filter.TestFilter('renderer_test',
Expand Down
6 changes: 1 addition & 5 deletions starboard/tools/testing/test_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,8 @@ class TestFilter(object):
target_name: The name of the unit test binary from which to remove tests.
test_name: The name of a specific test from the provided test target, or a
constant from this module defining a group of tests to filter.
config: An optional argument specifying for which build configuration
the test should be excluded. If this name is not provided, the test
will be excluded from all test runs.
"""

def __init__(self, target_name, test_name, config=None):
def __init__(self, target_name, test_name):
self.target_name = target_name
self.test_name = test_name
self.config = config
15 changes: 5 additions & 10 deletions starboard/tools/testing/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def _EnsureBuildDirectoryExists(path):
warnings.warn(f"'{path}' does not exist.")


def _FilterTests(target_list, filters, config_name):
def _FilterTests(target_list, filters):
"""Returns a Mapping of test targets -> filtered tests."""
targets = {}
for target in target_list:
Expand All @@ -67,10 +67,6 @@ def _FilterTests(target_list, filters, config_name):
if platform_filter == test_filter.DISABLE_TESTING:
return {}

# Only filter the tests specifying our config or all configs.
if platform_filter.config and platform_filter.config != config_name:
continue

target_name = platform_filter.target_name
if platform_filter.test_name == test_filter.FILTER_ALL:
if target_name in targets:
Expand Down Expand Up @@ -351,8 +347,7 @@ def _GetSpecifiedTestTargets(self, specified_targets):
RuntimeError: The specified test binary has been disabled for the given
platform and configuration.
"""
targets = _FilterTests(specified_targets, self._GetTestFilters(),
self.config)
targets = _FilterTests(specified_targets, self._GetTestFilters())
if len(targets) != len(specified_targets):
# If any of the provided target names have been filtered,
# they will not all run.
Expand All @@ -379,7 +374,7 @@ def _GetTestTargets(self, platform_tests_only):
targets.extend(self._app_config.GetTestTargets())
targets = list(set(targets))

final_targets = _FilterTests(targets, self._GetTestFilters(), self.config)
final_targets = _FilterTests(targets, self._GetTestFilters())
if not final_targets:
sys.stderr.write("All tests were filtered; no tests will be run.\n")

Expand Down Expand Up @@ -624,8 +619,8 @@ def _CollectFailedTests(self, lines):
return failed_tests

def _GetFilteredTestList(self, target_name):
return _FilterTests([target_name], self._GetTestFilters(),
self.config).get(target_name, [])
return _FilterTests([target_name],
self._GetTestFilters()).get(target_name, [])

def _ProcessAllTestResults(self, results):
"""Collects and returns output for all selected tests.
Expand Down

0 comments on commit 826241f

Please sign in to comment.