Skip to content

Commit

Permalink
Re-enable black_box_test framework on Android arm
Browse files Browse the repository at this point in the history
Enable blackbox tests on Android arm.
Some failed test cases are filtered and the list is added in
configuration.py.
This effort is tracked by b/291648592.

b/165629644
  • Loading branch information
maxz-lab committed Jul 25, 2023
1 parent e69694c commit c829393
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 3 deletions.
14 changes: 11 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,14 @@ 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
46 changes: 46 additions & 0 deletions starboard/android/arm/cobalt/configuration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 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 x86 Cobalt configuration."""

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


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

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

# A map of failing or crashing tests per target
__FILTERED_TESTS = { # pylint: disable=invalid-name
'renderer_test': [
'LottieCoveragePixelTest/LottiePixelTest.Run/skottie_luma_matte_json',
],
'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',
],
}

0 comments on commit c829393

Please sign in to comment.