Remove now unused extra args/opts/env from run_tests.py. (flutter/engine#55164)

As a result of https://github.com/flutter/flutter/issues/133569, Dart tests all use the standard `dart test` runner _or_ `engine_repo_tools` to find paths.
This commit is contained in:
Matan Lurey 2024-09-12 18:22:18 -07:00 committed by GitHub
parent 02d5118165
commit c53db189c1

View File

@ -915,17 +915,8 @@ def gather_dart_smoke_test(build_dir, test_filter):
)
def gather_dart_package_tests(build_dir, package_path, extra_opts):
def gather_dart_package_tests(build_dir, package_path):
if uses_package_test_runner(package_path):
# Assert that extra_opts is either None, or is an empty list, or is a dictionary.
assert len(extra_opts) == 0 or isinstance(
extra_opts, dict
), '%s uses package:test and expects a dictionary, but passed a %s' % (
package_path, type(extra_opts)
)
extra_env = {}
if isinstance(extra_opts, dict):
extra_env = extra_opts
opts = ['test', '--reporter=expanded']
yield EngineExecutableTask(
build_dir,
@ -933,14 +924,13 @@ def gather_dart_package_tests(build_dir, package_path, extra_opts):
None,
flags=opts,
cwd=package_path,
extra_env=extra_env
)
else:
dart_tests = glob.glob('%s/test/*_test.dart' % package_path)
if not dart_tests:
raise Exception('No tests found for Dart package at %s' % package_path)
for dart_test_file in dart_tests:
opts = [dart_test_file] + extra_opts
opts = [dart_test_file]
yield EngineExecutableTask(
build_dir, os.path.join('dart-sdk', 'bin', 'dart'), None, flags=opts, cwd=package_path
)
@ -977,29 +967,24 @@ def uses_package_test_runner(package):
# arguments to pass to each of the packages tests.
def build_dart_host_test_list(build_dir):
dart_host_tests = [
(os.path.join('flutter', 'ci'), []),
(os.path.join('flutter', 'flutter_frontend_server'), []),
(os.path.join('flutter', 'testing', 'skia_gold_client'), []),
(os.path.join('flutter', 'testing', 'scenario_app'), []),
(
os.path.join('flutter', 'ci'),
os.path.join('flutter', 'flutter_frontend_server'),
os.path.join('flutter', 'testing', 'skia_gold_client'),
os.path.join('flutter', 'testing', 'scenario_app'),
os.path.join('flutter', 'tools', 'api_check'),
[],
),
(os.path.join('flutter', 'tools', 'build_bucket_golden_scraper'), []),
(os.path.join('flutter', 'tools', 'clang_tidy'), []),
(os.path.join('flutter', 'tools', 'const_finder'), []),
(os.path.join('flutter', 'tools', 'dir_contents_diff'), []),
(os.path.join('flutter', 'tools', 'engine_tool'), []),
(os.path.join('flutter', 'tools', 'githooks'), []),
(os.path.join('flutter', 'tools', 'header_guard_check'), []),
(os.path.join('flutter', 'tools', 'pkg', 'engine_build_configs'), []),
(os.path.join('flutter', 'tools', 'pkg', 'engine_repo_tools'), []),
(os.path.join('flutter', 'tools', 'pkg', 'git_repo_tools'), []),
os.path.join('flutter', 'tools', 'build_bucket_golden_scraper'),
os.path.join('flutter', 'tools', 'clang_tidy'),
os.path.join('flutter', 'tools', 'const_finder'),
os.path.join('flutter', 'tools', 'dir_contents_diff'),
os.path.join('flutter', 'tools', 'engine_tool'),
os.path.join('flutter', 'tools', 'githooks'),
os.path.join('flutter', 'tools', 'header_guard_check'),
os.path.join('flutter', 'tools', 'pkg', 'engine_build_configs'),
os.path.join('flutter', 'tools', 'pkg', 'engine_repo_tools'),
os.path.join('flutter', 'tools', 'pkg', 'git_repo_tools'),
]
if not is_asan(build_dir):
dart_host_tests += [
(os.path.join('flutter', 'tools', 'path_ops', 'dart'), []),
]
dart_host_tests += [os.path.join('flutter', 'tools', 'path_ops', 'dart')]
return dart_host_tests
@ -1333,8 +1318,8 @@ Flutter Wiki page on the subject: https://github.com/flutter/flutter/wiki/Testin
engine_filter,
repeat_flags,
coverage=args.coverage,
gtest=True,
extra_env=extra_env,
gtest=True
)
finally:
xvfb.stop_virtual_x(build_name)
@ -1349,13 +1334,12 @@ Flutter Wiki page on the subject: https://github.com/flutter/flutter/wiki/Testin
dart_filter = args.dart_host_filter.split(',') if args.dart_host_filter else None
dart_host_packages = build_dart_host_test_list(build_dir)
tasks = []
for dart_host_package, extra_opts in dart_host_packages:
for dart_host_package in dart_host_packages:
if dart_filter is None or dart_host_package in dart_filter:
tasks += list(
gather_dart_package_tests(
build_dir,
os.path.join(BUILDROOT_DIR, dart_host_package),
extra_opts,
)
)