Remove extra test targets from inside build script

Due to branch constraints, remove the extra targets defined inside the
build script and revert to having them be passed in via command line.

Test: ./build/make/ci/build_test_suites_x86_64-trunk_staging --target_product aosp_x86_64 --target_release trunk_staging --with_dexpreopt_boot_img_and_system_server_only <extra_targets>
Bug: 314171817
Change-Id: I89a82e969d294104f587d778ad319a41905320f8
This commit is contained in:
Luca Farsi 2024-03-19 16:47:54 -07:00
parent 6d5a509efa
commit 2dc1701741
2 changed files with 10 additions and 21 deletions

View file

@ -16,15 +16,4 @@
import sys
import build_test_suites
build_test_suites.main(
sys.argv,
extra_targets=[
'acts_tests',
'cts',
'host-unit-tests',
'robolectric-tests',
'test_mapping',
'tradefed-all',
'vts',
],
)
build_test_suites.main(sys.argv)

View file

@ -36,15 +36,15 @@ REQUIRED_MODULES = frozenset(
)
def build_test_suites(argv, extra_targets: set[str]):
def build_test_suites(argv):
args = parse_args(argv)
if is_optimization_enabled():
# Call the class to map changed files to modules to build.
# TODO(lucafarsi): Move this into a replaceable class.
build_affected_modules(args, extra_targets)
build_affected_modules(args)
else:
build_everything(args, extra_targets)
build_everything(args)
def parse_args(argv):
@ -71,20 +71,20 @@ def is_optimization_enabled() -> bool:
return False
def build_everything(args: argparse.Namespace, extra_targets: set[str]):
build_command = base_build_command(args, extra_targets)
def build_everything(args: argparse.Namespace):
build_command = base_build_command(args, args.extra_targets)
build_command.append('general-tests')
run_command(build_command, print_output=True)
def build_affected_modules(args: argparse.Namespace, extra_targets: set[str]):
def build_affected_modules(args: argparse.Namespace):
modules_to_build = find_modules_to_build(
pathlib.Path(args.change_info), args.extra_required_modules
)
# Call the build command with everything.
build_command = base_build_command(args, extra_targets)
build_command = base_build_command(args, args.extra_targets)
build_command.extend(modules_to_build)
# When not building general-tests we also have to build the general tests
# shared libs.
@ -410,5 +410,5 @@ def get_soong_var(var: str, target_release: str) -> str:
return value
def main(argv, extra_targets: set[str]):
build_test_suites(argv, extra_targets)
def main(argv):
build_test_suites(argv)