Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18f6e105 authored by Luca Farsi's avatar Luca Farsi
Browse files

Add option for test discovery info mode

Add a command line option to enable test discovery info mode, where
enabling it will cause test discovery to run and report results but not
actually affect the build. This is useful for rolling out to new targets
without immediately enabling test discovery mode.

Test: atest build_test_suites_test
Bug: 388833029
Change-Id: I8baf73e6353e4c3d7d6836c4f9823341a7f8b5dd
parent b1d766b9
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -84,14 +84,14 @@ class BuildPlanner:
    packaging_commands_getters = []
    # In order to roll optimizations out differently between test suites and
    # device builds, we have separate flags.
    enable_discovery = ('test_suites_zip_test_discovery'
    enable_discovery = (('test_suites_zip_test_discovery'
        in self.build_context.enabled_build_features
        and not self.args.device_build
    ) or (
        'device_zip_test_discovery'
        in self.build_context.enabled_build_features
        and self.args.device_build
    )
    )) and not self.args.test_discovery_info_mode
    logging.info(f'Discovery mode is enabled= {enable_discovery}')
    preliminary_build_targets = self._collect_preliminary_build_targets(enable_discovery)

@@ -252,6 +252,11 @@ def parse_args(argv: list[str]) -> argparse.Namespace:
      action='store_true',
      help='Flag to indicate running a device build.',
  )
  argparser.add_argument(
      '--test_discovery_info_mode',
      action='store_true',
      help='Flag to enable running test discovery in info only mode.',
  )

  return argparser.parse_args(argv)