From 336dfc3a0cfb44b653e3446616f9460f3349183f Mon Sep 17 00:00:00 2001 From: Hzj_jie Date: Tue, 14 May 2024 10:33:12 -0700 Subject: [PATCH 1/8] redo --- DEPS | 4 ++-- ci/licenses_golden/licenses_fuchsia | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index 8408f185873f5..373a3e498c9a5 100644 --- a/DEPS +++ b/DEPS @@ -251,7 +251,7 @@ vars = { # The version / instance id of the cipd:chromium/fuchsia/test-scripts which # will be used altogether with fuchsia-sdk to setup the build / test # environment. - 'fuchsia_test_scripts_version': 'XtkBHdNTtIpWdxN_lUNf6VqnvPUhvGTYgPDqob1R65EC', + 'fuchsia_test_scripts_version': 'xaXvbqb30ptuk-YUuNuc_kr7-O1pXjTciN5eWCoRiPAC', # The version / instance id of the cipd:chromium/fuchsia/gn-sdk which will be # used altogether with fuchsia-sdk to generate gn based build rules. @@ -979,7 +979,7 @@ deps = { 'packages': [ { 'package': 'fuchsia/sdk/core/linux-amd64', - 'version': 'NbCi2ETfLHPLLB-JV-CbRyGWfH9aQyMWXB6ad7yxh1oC' + 'version': '0s5A_38LSaIiswXq_PglT2Zvh0zGVumzo4GD9I_2MXYC' } ], 'condition': 'download_fuchsia_deps and not download_fuchsia_sdk', diff --git a/ci/licenses_golden/licenses_fuchsia b/ci/licenses_golden/licenses_fuchsia index abc977211eed1..5e70f5d140fa3 100644 --- a/ci/licenses_golden/licenses_fuchsia +++ b/ci/licenses_golden/licenses_fuchsia @@ -1,4 +1,4 @@ -Signature: b68f1249e4a65614d0a0cc49a11f0611 +Signature: 986be97475d4bc32c46d0bffd183ec18 ==================================================================================================== LIBRARY: fuchsia_sdk From d387249dcb65545e5d3b4f78099b2dd622a30b20 Mon Sep 17 00:00:00 2001 From: Hzj_jie Date: Wed, 7 Aug 2024 11:15:03 -0700 Subject: [PATCH 2/8] update deps --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 451a21fea9817..8092abcb754e2 100644 --- a/DEPS +++ b/DEPS @@ -251,7 +251,7 @@ vars = { # The version / instance id of the cipd:chromium/fuchsia/test-scripts which # will be used altogether with fuchsia-sdk to setup the build / test # environment. - 'fuchsia_test_scripts_version': 'xaXvbqb30ptuk-YUuNuc_kr7-O1pXjTciN5eWCoRiPAC', + 'fuchsia_test_scripts_version': '3FWYCLt6cV86gWU8Eg5q-BX0f6bnLSYR_27qRWwn5qQC', # The version / instance id of the cipd:chromium/fuchsia/gn-sdk which will be # used altogether with fuchsia-sdk to generate gn based build rules. From 447cc260f4c157b56f5395fcf89a22c85a2157ce Mon Sep 17 00:00:00 2001 From: Hzj_jie Date: Wed, 7 Aug 2024 11:23:09 -0700 Subject: [PATCH 3/8] format --- testing/fuchsia/run_tests.py | 60 ++++++------------------------------ 1 file changed, 10 insertions(+), 50 deletions(-) diff --git a/testing/fuchsia/run_tests.py b/testing/fuchsia/run_tests.py index f315a6887c57e..466ddfbcbd04c 100755 --- a/testing/fuchsia/run_tests.py +++ b/testing/fuchsia/run_tests.py @@ -33,7 +33,7 @@ ) # pylint: disable=import-error, wrong-import-position -import run_test +from bundled_test_runner import run_tests, TestCase from common import DIR_SRC_ROOT from run_executable_test import ExecutableTestRunner from test_runner import TestRunner @@ -48,36 +48,6 @@ OUT_DIR = os.path.join(DIR_SRC_ROOT, 'out', VARIANT) -# Visible for testing -class TestCase(NamedTuple): - package: str - args: str = '' - - -class _BundledTestRunner(TestRunner): - - # private, use bundled_test_runner_of function instead. - def __init__(self, target_id: str, package_deps: Set[str], tests: List[TestCase], logs_dir: str): - super().__init__(OUT_DIR, [], None, target_id, list(package_deps)) - self.tests = tests - self.logs_dir = logs_dir - - def run_test(self) -> CompletedProcess: - returncode = 0 - for test in self.tests: - assert test.package.endswith('.cm') - test_runner = ExecutableTestRunner( - OUT_DIR, test.args.split(), test.package, self._target_id, None, self.logs_dir, [], None - ) - # pylint: disable=protected-access - test_runner._package_deps = self._package_deps - result = test_runner.run_test().returncode - logging.info('Result of test %s is %s', test, result) - if result != 0: - returncode = result - return CompletedProcess(args='', returncode=returncode) - - # Visible for testing def resolve_packages(tests: Iterable[Mapping[str, Any]]) -> Set[str]: packages = set() @@ -121,8 +91,14 @@ def build_test_cases(tests: Iterable[Mapping[str, Any]]) -> List[TestCase]: return test_cases -def _bundled_test_runner_of(target_id: str) -> _BundledTestRunner: - log_dir = os.environ.get('FLUTTER_LOGS_DIR', '/tmp/log') +if __name__ == '__main__': + logging.basicConfig(level=logging.INFO) + logging.info('Running tests in %s', OUT_DIR) + sys.argv.append('--out-dir=' + OUT_DIR) + if VARIANT.endswith('_arm64') or VARIANT.endswith('_arm64_tester'): + sys.argv.append('--product=terminal.qemu-arm64') + + logs_dir = os.environ.get('FLUTTER_LOGS_DIR', '/tmp/log') with open(os.path.join(os.path.dirname(__file__), 'test_suites.yaml'), 'r') as file: tests = yaml.safe_load(file) # TODO(zijiehe-google-com): Run all tests in release build, @@ -131,21 +107,5 @@ def variant(test) -> bool: return 'variant' not in test or test['variant'] in VARIANT tests = [t for t in tests if variant(t)] - return _BundledTestRunner(target_id, resolve_packages(tests), build_test_cases(tests), log_dir) - -def _get_test_runner(runner_args: argparse.Namespace, *_) -> TestRunner: - return _bundled_test_runner_of(runner_args.target_id) - - -if __name__ == '__main__': - logging.basicConfig(level=logging.INFO) - logging.info('Running tests in %s', OUT_DIR) - sys.argv.append('--out-dir=' + OUT_DIR) - if VARIANT.endswith('_arm64') or VARIANT.endswith('_arm64_tester'): - sys.argv.append('--product=terminal.qemu-arm64') - # The 'flutter-test-type' is a place holder and has no specific meaning; the - # _get_test_runner is overrided. - sys.argv.append('flutter-test-type') - run_test._get_test_runner = _get_test_runner # pylint: disable=protected-access - sys.exit(run_test.main()) + sys.exit(run_tests(resolve_packages(tests), build_test_cases(tests), logs_dir)) From dc6709d1b7c46f1308a408e7268c730e7696f3d6 Mon Sep 17 00:00:00 2001 From: Hzj_jie Date: Wed, 7 Aug 2024 11:27:31 -0700 Subject: [PATCH 4/8] deps --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 8092abcb754e2..88ecaacd7cd9d 100644 --- a/DEPS +++ b/DEPS @@ -255,7 +255,7 @@ vars = { # The version / instance id of the cipd:chromium/fuchsia/gn-sdk which will be # used altogether with fuchsia-sdk to generate gn based build rules. - 'fuchsia_gn_sdk_version': 'RgErspyYHapUO2SpcW-vo2p8yaRUMUrq0eWjRVPfQjoC', + 'fuchsia_gn_sdk_version': 'sbh76PYVTMxav4ACTgA-TXWcbZTZcWWjsqATCxrGIvwC', } gclient_gn_args_file = 'src/flutter/third_party/dart/build/config/gclient_args.gni' From ad4da407f2a40c48e75f620a30eb9334ee7199df Mon Sep 17 00:00:00 2001 From: Hzj_jie Date: Wed, 7 Aug 2024 13:14:14 -0700 Subject: [PATCH 5/8] format --- testing/fuchsia/run_tests.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/testing/fuchsia/run_tests.py b/testing/fuchsia/run_tests.py index 466ddfbcbd04c..839bf14d7e725 100755 --- a/testing/fuchsia/run_tests.py +++ b/testing/fuchsia/run_tests.py @@ -12,13 +12,11 @@ # Use of this source code is governed by a BSD-style license that can be found # in the LICENSE file. -import argparse import logging import os import sys -from subprocess import CompletedProcess -from typing import Any, Iterable, List, Mapping, NamedTuple, Set +from typing import Any, Iterable, List, Mapping, Set # The import is coming from vpython wheel and pylint cannot find it. import yaml # pylint: disable=import-error @@ -35,8 +33,6 @@ # pylint: disable=import-error, wrong-import-position from bundled_test_runner import run_tests, TestCase from common import DIR_SRC_ROOT -from run_executable_test import ExecutableTestRunner -from test_runner import TestRunner if len(sys.argv) == 2: VARIANT = sys.argv[1] @@ -91,7 +87,7 @@ def build_test_cases(tests: Iterable[Mapping[str, Any]]) -> List[TestCase]: return test_cases -if __name__ == '__main__': +def main() -> int: logging.basicConfig(level=logging.INFO) logging.info('Running tests in %s', OUT_DIR) sys.argv.append('--out-dir=' + OUT_DIR) @@ -108,4 +104,8 @@ def variant(test) -> bool: tests = [t for t in tests if variant(t)] - sys.exit(run_tests(resolve_packages(tests), build_test_cases(tests), logs_dir)) + return run_tests(resolve_packages(tests), build_test_cases(tests), logs_dir) + + +if __name__ == '__main__': + sys.exit(main()) From 3f191f959437adb7f9c6ba1d11e90a87b1f24506 Mon Sep 17 00:00:00 2001 From: Hzj_jie Date: Thu, 8 Aug 2024 13:47:37 -0700 Subject: [PATCH 6/8] go --- testing/fuchsia/run_tests.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/testing/fuchsia/run_tests.py b/testing/fuchsia/run_tests.py index 839bf14d7e725..42963d7f18ff3 100755 --- a/testing/fuchsia/run_tests.py +++ b/testing/fuchsia/run_tests.py @@ -33,6 +33,7 @@ # pylint: disable=import-error, wrong-import-position from bundled_test_runner import run_tests, TestCase from common import DIR_SRC_ROOT +from compatible_utils import force_running_unattended if len(sys.argv) == 2: VARIANT = sys.argv[1] @@ -90,11 +91,12 @@ def build_test_cases(tests: Iterable[Mapping[str, Any]]) -> List[TestCase]: def main() -> int: logging.basicConfig(level=logging.INFO) logging.info('Running tests in %s', OUT_DIR) + force_running_unattended() sys.argv.append('--out-dir=' + OUT_DIR) if VARIANT.endswith('_arm64') or VARIANT.endswith('_arm64_tester'): sys.argv.append('--product=terminal.qemu-arm64') - logs_dir = os.environ.get('FLUTTER_LOGS_DIR', '/tmp/log') + sys.argv.append('--logs-dir=' + os.environ.get('FLUTTER_LOGS_DIR', '/tmp/log')) with open(os.path.join(os.path.dirname(__file__), 'test_suites.yaml'), 'r') as file: tests = yaml.safe_load(file) # TODO(zijiehe-google-com): Run all tests in release build, @@ -103,8 +105,9 @@ def variant(test) -> bool: return 'variant' not in test or test['variant'] in VARIANT tests = [t for t in tests if variant(t)] - - return run_tests(resolve_packages(tests), build_test_cases(tests), logs_dir) + for package in resolve_packages(tests): + sys.argv.append('--packages=' + package) + return run_tests(build_test_cases(tests)) if __name__ == '__main__': From 1d66239ec9ca100e626e4c22b73da1fefe9ab74c Mon Sep 17 00:00:00 2001 From: Hzj_jie Date: Thu, 8 Aug 2024 13:48:29 -0700 Subject: [PATCH 7/8] format --- testing/fuchsia/run_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/fuchsia/run_tests.py b/testing/fuchsia/run_tests.py index 42963d7f18ff3..b289ad5fb4971 100755 --- a/testing/fuchsia/run_tests.py +++ b/testing/fuchsia/run_tests.py @@ -106,7 +106,7 @@ def variant(test) -> bool: tests = [t for t in tests if variant(t)] for package in resolve_packages(tests): - sys.argv.append('--packages=' + package) + sys.argv.append('--packages=' + package) return run_tests(build_test_cases(tests)) From 83b0a9991cac8cb02ba7b20812bf0fd08189bced Mon Sep 17 00:00:00 2001 From: Hzj_jie Date: Sat, 10 Aug 2024 11:14:22 -0700 Subject: [PATCH 8/8] go --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 0afb27796bd30..4bcc4b91434fc 100644 --- a/DEPS +++ b/DEPS @@ -251,7 +251,7 @@ vars = { # The version / instance id of the cipd:chromium/fuchsia/test-scripts which # will be used altogether with fuchsia-sdk to setup the build / test # environment. - 'fuchsia_test_scripts_version': 'AYS3tfC91ZRfdmIL01HjRhue-6gbbMMwad4lTp_d12oC', + 'fuchsia_test_scripts_version': '8WCo7tLjg_GoImlj5eax_w-wxsvRPnmaChqN4ok-5rYC', # The version / instance id of the cipd:chromium/fuchsia/gn-sdk which will be # used altogether with fuchsia-sdk to generate gn based build rules.