Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable black_box_test framework on Android arm #1033

Merged
merged 1 commit into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions cobalt/black_box_tests/black_box_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
from starboard.tools import log_level

_DISABLED_BLACKBOXTEST_CONFIGS = [
'android-arm/devel',
'android-arm64/devel',
'android-x86/devel',
'evergreen-arm/devel',
Expand Down Expand Up @@ -179,6 +178,9 @@ def LoadTests(launcher_params, test_set):
loader_out_directory=launcher_params.loader_out_directory)

test_targets = []
test_filters = build.GetPlatformConfig(
_launcher_params.platform).GetApplicationConfiguration(
'cobalt').GetTestFilters()

if test_set in ['all', 'blackbox']:
test_targets = _TESTS_NO_SIGNAL
Expand All @@ -194,8 +196,15 @@ def LoadTests(launcher_params, test_set):

test_suite = unittest.TestSuite()
for test in test_targets:
test_suite.addTest(unittest.TestLoader().loadTestsFromModule(
importlib.import_module(_TEST_DIR_PATH + test)))
filter_hit = 0
for filtered_test in test_filters:
if (test_set == filtered_test.target_name and
test == filtered_test.test_name):
filter_hit = 1
continue
if filter_hit == 0:
test_suite.addTest(unittest.TestLoader().loadTestsFromModule(
importlib.import_module(_TEST_DIR_PATH + test)))
return test_suite


Expand Down
43 changes: 43 additions & 0 deletions starboard/android/arm/cobalt/configuration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright 2023 The Cobalt Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Starboard Android arm Cobalt configuration."""

from starboard.android.shared.cobalt import configuration
from starboard.tools.testing import test_filter

# A map of failing or crashing tests per target
_FILTERED_TESTS = {
'blackbox': [
'web_debugger',
'cancel_sync_loads_when_suspended',
'preload_font',
'preload_visibility',
'preload_launch_parameter',
'suspend_visibility',
'timer_hit_after_preload',
'timer_hit_in_preload',
'deep_links',
'web_platform_tests',
],
}


class CobaltAndroidArmConfiguration(configuration.CobaltAndroidConfiguration):
"""Starboard Android Arm Cobalt configuration."""

def GetTestFilters(self):
filters = super().GetTestFilters()
for target, tests in _FILTERED_TESTS.items():
filters.extend(test_filter.TestFilter(target, test) for test in tests)
return filters