def _initializeDataDependencyAttributes(self, args, isolate_delegate): self._data_deps = [] if (args.isolate_file_path and not isolator.IsIsolateEmpty(args.isolate_file_path)): if os.path.isabs(args.isolate_file_path): self._isolate_abs_path = args.isolate_file_path else: self._isolate_abs_path = os.path.join( constants.DIR_SOURCE_ROOT, args.isolate_file_path) self._isolate_delegate = isolate_delegate self._isolated_abs_path = os.path.join( constants.GetOutDirectory(), '%s.isolated' % self._test_package) else: self._isolate_delegate = None # TODO(jbudorick): Deprecate and remove --test-data once data dependencies # are fully converted to isolate. if args.test_data: logging.info('Data dependencies specified via --test-data') self._test_data = args.test_data else: self._test_data = None if not self._isolate_delegate and not self._test_data: logging.warning('No data dependencies will be pushed.')
def _initializeDataDependencyAttributes(self, args, isolate_delegate): self._data_deps = [] if (args.isolate_file_path and not isolator.IsIsolateEmpty(args.isolate_file_path)): if os.path.isabs(args.isolate_file_path): self._isolate_abs_path = args.isolate_file_path else: self._isolate_abs_path = os.path.join( constants.DIR_SOURCE_ROOT, args.isolate_file_path) self._isolate_delegate = isolate_delegate self._isolated_abs_path = os.path.join( constants.GetOutDirectory(), '%s.isolated' % self._test_package) else: self._isolate_delegate = None if not self._isolate_delegate: logging.warning('No data dependencies will be pushed.')
def __init__(self, args, isolate_delegate, error_func): super(GtestTestInstance, self).__init__() # TODO(jbudorick): Support multiple test suites. if len(args.suite_name) > 1: raise ValueError( 'Platform mode currently supports only 1 gtest suite') self._extract_test_list_from_filter = args.extract_test_list_from_filter self._shard_timeout = args.shard_timeout self._suite = args.suite_name[0] self._exe_dist_dir = None # GYP: if args.executable_dist_dir: self._exe_dist_dir = os.path.abspath(args.executable_dist_dir) else: # TODO(agrieve): Remove auto-detection once recipes pass flag explicitly. exe_dist_dir = os.path.join(constants.GetOutDirectory(), '%s__dist' % self._suite) if os.path.exists(exe_dist_dir): self._exe_dist_dir = exe_dist_dir incremental_part = '' if args.test_apk_incremental_install_script: incremental_part = '_incremental' apk_path = os.path.join( constants.GetOutDirectory(), '%s_apk' % self._suite, '%s-debug%s.apk' % (self._suite, incremental_part)) self._test_apk_incremental_install_script = ( args.test_apk_incremental_install_script) if not os.path.exists(apk_path): self._apk_helper = None else: self._apk_helper = apk_helper.ApkHelper(apk_path) self._extras = { _EXTRA_NATIVE_TEST_ACTIVITY: self._apk_helper.GetActivityName(), } if self._suite in RUN_IN_SUB_THREAD_TEST_SUITES: self._extras[_EXTRA_RUN_IN_SUB_THREAD] = 1 if self._suite in BROWSER_TEST_SUITES: self._extras[_EXTRA_SHARD_SIZE_LIMIT] = 1 self._extras[EXTRA_SHARD_NANO_TIMEOUT] = int( 1e9 * self._shard_timeout) self._shard_timeout = 10 * self._shard_timeout if not self._apk_helper and not self._exe_dist_dir: error_func('Could not find apk or executable for %s' % self._suite) self._data_deps = [] if args.test_filter: self._gtest_filter = args.test_filter elif args.test_filter_file: with open(args.test_filter_file, 'r') as f: self._gtest_filter = ':'.join(l.strip() for l in f) else: self._gtest_filter = None if (args.isolate_file_path and not isolator.IsIsolateEmpty(args.isolate_file_path)): self._isolate_abs_path = os.path.abspath(args.isolate_file_path) self._isolate_delegate = isolate_delegate self._isolated_abs_path = os.path.join(constants.GetOutDirectory(), '%s.isolated' % self._suite) else: logging.warning( '%s isolate file provided. No data deps will be pushed.', 'Empty' if args.isolate_file_path else 'No') self._isolate_delegate = None if args.app_data_files: self._app_data_files = args.app_data_files if args.app_data_file_dir: self._app_data_file_dir = args.app_data_file_dir else: self._app_data_file_dir = tempfile.mkdtemp() logging.critical('Saving app files to %s', self._app_data_file_dir) else: self._app_data_files = None self._app_data_file_dir = None self._test_arguments = args.test_arguments # TODO(jbudorick): Remove this once it's deployed. self._enable_xml_result_parsing = args.enable_xml_result_parsing