• Home
  • Raw
  • Download

Lines Matching +full:runner +full:- +full:before +full:- +full:script

4 # Use of this source code is governed by a BSD-style license that can be
6 """This script facilitates running tests for lacros on Linux.
9 to setup build directory with the lacros-chrome-on-linux build configuration,
19 executed with the latest version of prebuilt ash-chrome, and the behavior is
25 --gtest_filter=BrowserTest.Title
31 --ash-chrome-version=120.0.6099.0
33 The above command runs tests with a given version of ash-chrome, which is
36 https://chrome-infra-packages.appspot.com/p/chromium/testing/linux-ash-chromium/x86_64/ash.zip
45 The above command starts ash-chrome with xvfb instead of an X11 window, and
48 For version skew testing when passing --ash-chrome-path-override, the runner
50 newer(major version larger), the runner will not run any tests and just
56 --gdb
57 --lldb
80 _ASH_CIPD_PATH = 'chromium/testing/linux-ash-chromium/x86_64/ash.zip'
83 # Directory to cache downloaded ash-chrome versions to avoid re-downloading.
91 # Number of seconds to wait for ash-chrome to start.
95 # List of targets that require ash-chrome as a Wayland server in order to run.
118 # List of targets that require ash-chrome to support crosapi mojo APIs.
130 'browser_tests': 'linux-lacros.browser_tests.filter',
131 'components_unittests': 'linux-lacros.components_unittests.filter',
132 'content_browsertests': 'linux-lacros.content_browsertests.filter',
133 'interactive_ui_tests': 'linux-lacros.interactive_ui_tests.filter',
135 'linux-lacros.lacros_chrome_browsertests.filter',
136 'sync_integration_tests': 'linux-lacros.sync_integration_tests.filter',
137 'unit_tests': 'linux-lacros.unit_tests.filter',
142 """Returns a path to the dir storing the downloaded version of ash-chrome."""
147 """Removes unused ash-chrome versions to save disk space.
149 Currently, when an ash-chrome zip is downloaded and unpacked, the atime/mtime
166 # The prebuilt ash-chrome dir is NOT supposed to contain any files, remove
173 age = time.time() - os.path.getatime(chrome_path)
176 'Removing ash-chrome: "%s" as it hasn\'t been used in the '
193 ['cipd', 'describe', _ASH_CIPD_PATH, '-version', 'canary'],
219 ['cipd', 'ensure', '-ensure-file', ensure_file_path, '-root', path])
225 Double check by running the chrome binary with --version.
237 cp = subprocess.run([test_ash_chrome, '--version'], capture_output=True)
239 if str(cp.stdout).find(version) == -1:
248 """Download a given version of ash-chrome if not already exists.
261 # runner process gets killed in the middle of unzipping (~2 seconds), but
279 """Waits for Ash-Chrome to be up and running and returns a boolean indicator.
281 Determine whether ash-chrome is up and running by checking whether two files
285 status of ash-chrome, likely through mojo connection.
292 ash_ready_file (str): Path to a non-existing file. After ash is ready for
296 A boolean indicating whether Ash-chrome is up and running.
331 'lacros_version_skew_tests_v(?P<version>[0-9]+).[0-9]+.[0-9]+.[0-9]+/',
373 return int(lines[0][lines[0].find('=') + 1:-1])
388 if arg.startswith('--test-launcher-summary-output='):
389 return arg[len('--test-launcher-summary-output='):]
394 """Detects if the script is running on bots or not.
400 True if the script is running on bots. Otherwise returns False.
402 return '--test-launcher-bot-mode' in forward_args
411 first_wait_secs: The grace period before sending first SIGTERM in seconds.
452 args (dict): Args for this script.
461 # parent script.
465 # Force the tests into single-process-test mode for debugging unless manually
468 if not ("--single-process" in forward_args
469 or "--single-process-tests" in forward_args):
470 forward_args += ["--single-process-tests"]
472 # Adding --single-process-tests can cause some tests to fail when they're
475 if not [i for i in forward_args if i.startswith("--gtest_filter")]:
476 logging.error("""Interactive debugging requested without --gtest_filter
478 This script adds --single-process-tests to support interactive debugging but
480 specify a --gtest_filter=Foo.Bar to name the test you want to debug.
491 'gdb', '--init-eval-command', 'source ' + gdbinit_file, '--args'
497 'lldb', '-O',
498 "script sys.path[:0] = ['%s']" % lldbinit_dir, '-O',
499 'script import lldbinit', '--'
506 """Runs tests with ash-chrome.
509 args (dict): Args for this script.
534 $ cipd auth-login
535 $ echo "chromium/testing/linux-ash-chromium/x86_64/ash.zip \
536 version:92.0.4515.130" > /tmp/ensure-file.txt
537 $ cipd ensure -ensure-file /tmp/ensure-file.txt \
538 -root lacros_version_skew_tests_v92.0.4515.130
539 Then you can use --ash-chrome-path-override=\
549 logging.info('Ash-chrome version: %s', ash_chrome_version)
554 # Starts Ash-Chrome.
562 lacros_mojo_socket_arg = ('--lacros-mojo-socket-for-testing=%s' %
567 ash_wayland_socket_name = 'wayland-exo'
574 '--user-data-dir=%s' % tmp_ash_data_dir_name,
575 '--enable-wayland-server',
576 '--no-startup-window',
577 '--disable-input-event-activation-protection',
578 '--disable-lacros-keep-alive',
579 '--disable-login-lacros-opening',
580 '--enable-field-trial-config',
581 '--enable-logging=stderr',
582 '--enable-features=LacrosSupport,LacrosPrimary,LacrosOnly',
583 '--ash-ready-file-path=%s' % ash_ready_file,
584 '--wayland-server-socket=%s' % ash_wayland_socket_name,
586 if '--enable-pixel-output-in-tests' not in forward_args:
587 ash_cmd.append('--disable-gl-drawing-for-tests')
595 # $ export ASH_WRAPPER="gnome-terminal -- gdb --ex=r --args"
626 logging.info("Running in the debugger and --ash-logging-path is not " +
632 logging.info('Writing ash-chrome logs to: %s', ash_log_path)
650 logging.info('Starting ash-chrome: ' + ' '.join(ash_cmd))
653 # this process group before exec-ing Ash. This prevents interactive
654 # Control-C from being seen by Ash. Otherwise Control-C in a debugger
655 # can kill Ash out from under the debugger. In non-debugger cases, this
656 # script attempts to clean up the spawned processes nicely.
679 logging.warning('Starting ash-chrome timed out after %ds',
692 raise RuntimeError('Timed out waiting for ash-chrome to start')
694 ash_elapsed_time = time.monotonic() - ash_start_time
695 logging.info('Started ash-chrome in %.3fs on try %d.', ash_elapsed_time,
702 forward_args.append('--ash-chrome-path=' + ash_chrome_file)
703 forward_args.append('--unique-ash-dir=' + tmp_unique_ash_dir_name)
740 args (dict): Args for this script.
763 # Exit code 128+n -> Fatal error signal "n".
769 [arg.startswith('--test-launcher-filter-file') for arg in forward_args])):
774 forward_args.append(f'--test-launcher-filter-file={file_path}')
780 args (dict): Args for this script.
784 RuntimeError: If the given test binary doesn't exist or the test runner
797 # behavior with a specified ash-chrome version, which makes sure that
823 '"./url_unittests". Any argument unknown to this test runner script will '
824 'be forwarded to the command, for example: "--gtest_filter=Suite.Test"')
828 '--ash-chrome-version',
830 help='Version of an prebuilt ash-chrome to use for testing, for example: '
835 '--ash-chrome-path',
837 help='Path to an locally built ash-chrome to use for testing. '
841 debugger_group.add_argument('--gdb',
844 debugger_group.add_argument('--lldb',
849 # an ash chrome and pass it using --ash-chrome-path. In order to use the same
853 '--ash-chrome-path-override',
855 help='The same as --ash-chrome-path. But this will override '
856 '--ash-chrome-path or --ash-chrome-version if any of these '
859 '--ash-logging-path',
861 help='File & path to ash-chrome logging output while running Lacros '
863 test_parser.add_argument('--combine-ash-logs-on-bots',
867 '--asan-symbolize-output',