Reland "Switch chrome_junit_tests to use generated scripts"
With the prerequisite coverage changes, we can reland this without
breaking coverage.
Change-Id: Id8d71831c473918e94c9ed29098a03fe1d717c5c
Bug: 1320434
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3922321
Commit-Queue: Gregory Guterman <guterman@google.com>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Reviewed-by: Benjamin Joyce (Ben) <bjoyce@chromium.org>
Reviewed-by: Stephanie Kim <kimstephanie@google.com>
Cr-Commit-Position: refs/heads/main@{#1071298}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
103d33f640
commit
2c2d27e31b
build/android/pylib/local/machine
testing/buildbot
tools/mb
@ -61,13 +61,13 @@ class LocalMachineJunitTestRun(test_run.TestRun):
|
||||
def SetUp(self):
|
||||
pass
|
||||
|
||||
def _GetFilterArgs(self, test_filter_override=None):
|
||||
def _GetFilterArgs(self, shard_test_filter=None):
|
||||
ret = []
|
||||
if test_filter_override:
|
||||
ret += ['-gtest-filter', ':'.join(test_filter_override)]
|
||||
elif self._test_instance.test_filters:
|
||||
for test_filter in self._test_instance.test_filters:
|
||||
ret += ['-gtest-filter', test_filter]
|
||||
if shard_test_filter:
|
||||
ret += ['-gtest-filter', ':'.join(shard_test_filter)]
|
||||
|
||||
for test_filter in self._test_instance.test_filters:
|
||||
ret += ['-gtest-filter', test_filter]
|
||||
|
||||
if self._test_instance.package_filter:
|
||||
ret += ['-package-filter', self._test_instance.package_filter]
|
||||
@ -84,8 +84,8 @@ class LocalMachineJunitTestRun(test_run.TestRun):
|
||||
jar_args_list = [['-json-results-file', result_file]
|
||||
for result_file in json_result_file_paths]
|
||||
for index, jar_arg in enumerate(jar_args_list):
|
||||
test_filter_override = group_test_list[index] if shards > 1 else None
|
||||
jar_arg += self._GetFilterArgs(test_filter_override)
|
||||
shard_test_filter = group_test_list[index] if shards > 1 else None
|
||||
jar_arg += self._GetFilterArgs(shard_test_filter)
|
||||
|
||||
return jar_args_list
|
||||
|
||||
@ -155,9 +155,7 @@ class LocalMachineJunitTestRun(test_run.TestRun):
|
||||
def RunTests(self, results, raw_logs_fh=None):
|
||||
# This avoids searching through the classparth jars for tests classes,
|
||||
# which takes about 1-2 seconds.
|
||||
# Do not shard when a test filter is present since we do not know at this
|
||||
# point which tests will be filtered out.
|
||||
if (self._test_instance.shards == 1 or self._test_instance.test_filters
|
||||
if (self._test_instance.shards == 1
|
||||
or self._test_instance.suite in _EXCLUDED_SUITES):
|
||||
test_classes = []
|
||||
shards = 1
|
||||
|
@ -31716,6 +31716,36 @@
|
||||
}
|
||||
],
|
||||
"isolated_scripts": [
|
||||
{
|
||||
"args": [
|
||||
"--test-launcher-filter-file=../../testing/buildbot/filters/android.nougat-x86-rel.chrome_junit_tests.filter"
|
||||
],
|
||||
"isolate_name": "chrome_junit_tests",
|
||||
"isolate_profile_data": true,
|
||||
"merge": {
|
||||
"args": [],
|
||||
"script": "//testing/merge_scripts/standard_isolated_script_merge.py"
|
||||
},
|
||||
"name": "chrome_junit_tests",
|
||||
"resultdb": {
|
||||
"enable": true,
|
||||
"has_native_resultdb_integration": true
|
||||
},
|
||||
"swarming": {
|
||||
"can_use_on_swarming_builders": true,
|
||||
"dimension_sets": [
|
||||
{
|
||||
"cores": "8",
|
||||
"cpu": "x86-64",
|
||||
"os": "Ubuntu-18.04",
|
||||
"pool": "chromium.tests"
|
||||
}
|
||||
],
|
||||
"service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com"
|
||||
},
|
||||
"test_id_prefix": "ninja://chrome/android:chrome_junit_tests/",
|
||||
"use_isolated_scripts_api": true
|
||||
},
|
||||
{
|
||||
"args": [
|
||||
"--gtest-benchmark-name=components_perftests",
|
||||
@ -32005,17 +32035,6 @@
|
||||
"test": "chrome_java_test_pagecontroller_junit_tests",
|
||||
"test_id_prefix": "ninja://chrome/test/android:chrome_java_test_pagecontroller_junit_tests/"
|
||||
},
|
||||
{
|
||||
"isolate_profile_data": true,
|
||||
"name": "chrome_junit_tests",
|
||||
"resultdb": {
|
||||
"enable": true,
|
||||
"has_native_resultdb_integration": true
|
||||
},
|
||||
"swarming": {},
|
||||
"test": "chrome_junit_tests",
|
||||
"test_id_prefix": "ninja://chrome/android:chrome_junit_tests/"
|
||||
},
|
||||
{
|
||||
"isolate_profile_data": true,
|
||||
"name": "components_junit_tests",
|
||||
|
@ -71,7 +71,7 @@ source_set("browser_tests_filters") {
|
||||
source_set("chrome_junit_tests_filters") {
|
||||
testonly = true
|
||||
|
||||
data = []
|
||||
data = [ "//testing/buildbot/filters/android.nougat-x86-rel.chrome_junit_tests.filter" ]
|
||||
}
|
||||
|
||||
source_set("chrome_public_test_apk_filters") {
|
||||
|
@ -0,0 +1,6 @@
|
||||
# crbug.com/1378315
|
||||
-org.chromium.chrome.browser.subscriptions.ImplicitPriceDropSubscriptionsManagerUnitTest*
|
||||
|
||||
# crbug.com/1378779
|
||||
-org.chromium.chrome.browser.share.link_to_text.LinkToTextHelperTest.hasTextFragment
|
||||
-org.chromium.chrome.browser.share.link_to_text.LinkToTextHelperTest.hasTextFragment_URLWithNoTextSelector
|
@ -443,7 +443,7 @@
|
||||
},
|
||||
"chrome_junit_tests": {
|
||||
"label": "//chrome/android:chrome_junit_tests",
|
||||
"type": "junit_test",
|
||||
"type": "generated_script",
|
||||
},
|
||||
"chrome_modern_public_bundle_smoke_test": {
|
||||
"label": "//chrome/android:chrome_modern_public_bundle_smoke_test",
|
||||
|
@ -635,6 +635,14 @@
|
||||
'isolate_profile_data': {
|
||||
'isolate_profile_data': True,
|
||||
},
|
||||
'junit-swarming': {
|
||||
'swarming': {
|
||||
'dimensions': {
|
||||
'cores': '8',
|
||||
'pool': 'chromium.tests',
|
||||
},
|
||||
},
|
||||
},
|
||||
'kitkat-x86-emulator': {
|
||||
'$mixin_append': {
|
||||
'args': [
|
||||
|
@ -1004,7 +1004,7 @@
|
||||
'chromium_gtests_for_win_and_linux_only': {
|
||||
},
|
||||
|
||||
'chromium_junit_tests': {
|
||||
'chromium_junit_tests_no_swarming': {
|
||||
'android_webview_junit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
@ -1117,6 +1117,133 @@
|
||||
},
|
||||
},
|
||||
|
||||
'chromium_junit_tests_scripts': {
|
||||
'chrome_junit_tests': {
|
||||
'args': [
|
||||
'--test-launcher-filter-file=../../testing/buildbot/filters/android.nougat-x86-rel.chrome_junit_tests.filter',
|
||||
],
|
||||
'mixins': [
|
||||
'x86-64',
|
||||
'linux-bionic',
|
||||
'junit-swarming',
|
||||
],
|
||||
'remove_mixins': [
|
||||
'emulator-4-cores',
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
'use_isolated_scripts_api': True,
|
||||
},
|
||||
},
|
||||
|
||||
# TODO(crbug.com/1320434): remove this once all junit tests are migrated
|
||||
'chromium_junit_tests_some_swarming': {
|
||||
'android_webview_junit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
'base_junit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
'build_junit_tests':{
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
'chrome_java_test_pagecontroller_junit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
'components_junit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
'content_junit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
'device_junit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
'junit_unit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
'keyboard_accessory_junit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
'media_base_junit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
'module_installer_junit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
'net_junit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
'paint_preview_junit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
'password_check_junit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
'password_manager_junit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
'services_junit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
'touch_to_fill_junit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
'ui_junit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
'webapk_client_junit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
'webapk_shell_apk_h2o_junit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
'webapk_shell_apk_junit_tests': {
|
||||
'remove_mixins': [
|
||||
'nougat-x86-emulator',
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
'chromium_linux_scripts': {
|
||||
'check_network_annotations': {
|
||||
'script': 'check_network_annotations.py',
|
||||
@ -6364,6 +6491,7 @@
|
||||
|
||||
'nougat_isolated_scripts': [
|
||||
'android_isolated_scripts',
|
||||
'chromium_junit_tests_scripts',
|
||||
'components_perftests_isolated_scripts',
|
||||
'monochrome_public_apk_checker_isolated_script',
|
||||
'telemetry_android_minidump_unittests_isolated_scripts',
|
||||
|
@ -574,7 +574,7 @@
|
||||
'microdump_stackwalk',
|
||||
],
|
||||
'test_suites': {
|
||||
'junit_tests': 'chromium_junit_tests',
|
||||
'junit_tests': 'chromium_junit_tests_no_swarming',
|
||||
},
|
||||
},
|
||||
'Android arm64 Builder (dbg)': {},
|
||||
@ -740,7 +740,7 @@
|
||||
],
|
||||
'test_suites': {
|
||||
'gtest_tests': 'android_marshmallow_gtests',
|
||||
'junit_tests': 'chromium_junit_tests',
|
||||
'junit_tests': 'chromium_junit_tests_no_swarming',
|
||||
'isolated_scripts': 'monochrome_public_apk_checker_isolated_script',
|
||||
},
|
||||
'os_type': 'android',
|
||||
@ -968,7 +968,7 @@
|
||||
'os_type': 'android',
|
||||
'test_suites': {
|
||||
'gtest_tests': 'android_nougat_emulator_gtests',
|
||||
'junit_tests': 'chromium_junit_tests',
|
||||
'junit_tests': 'chromium_junit_tests_some_swarming',
|
||||
'isolated_scripts': 'nougat_isolated_scripts',
|
||||
'scripts': 'chromium_android_scripts',
|
||||
},
|
||||
@ -1542,7 +1542,7 @@
|
||||
# This mirrors 'android-lollipop-arm-rel'.
|
||||
'test_suites': {
|
||||
'gtest_tests': 'chromium_android_gtests',
|
||||
'junit_tests': 'chromium_junit_tests',
|
||||
'junit_tests': 'chromium_junit_tests_no_swarming',
|
||||
'isolated_scripts': 'monochrome_public_apk_checker_isolated_script_and_sizes',
|
||||
},
|
||||
'os_type': 'android',
|
||||
@ -2958,7 +2958,7 @@
|
||||
],
|
||||
'test_suites': {
|
||||
'gtest_tests': 'android_pie_coverage_gtests',
|
||||
'junit_tests': 'chromium_junit_tests',
|
||||
'junit_tests': 'chromium_junit_tests_no_swarming',
|
||||
},
|
||||
'os_type': 'android',
|
||||
},
|
||||
|
@ -1710,6 +1710,23 @@ class MetaBuildWrapper:
|
||||
is_win = self.platform == 'win32' or 'target_os="win"' in vals['gn_args']
|
||||
is_lacros = 'chromeos_is_browser_only=true' in vals['gn_args']
|
||||
|
||||
# This should be true if tests with type='windowed_test_launcher' are
|
||||
# expected to run using xvfb. For example, Linux Desktop, X11 CrOS and
|
||||
# Ozone CrOS builds on Linux (xvfb is not used on CrOS HW or VMs). Note
|
||||
# that one Ozone build can be used to run different backends. Currently,
|
||||
# tests are executed for the headless and X11 backends and both can run
|
||||
# under Xvfb on Linux.
|
||||
use_xvfb = (self.platform.startswith('linux') and not is_android
|
||||
and not is_fuchsia and not is_cros_device)
|
||||
|
||||
asan = 'is_asan=true' in vals['gn_args']
|
||||
msan = 'is_msan=true' in vals['gn_args']
|
||||
tsan = 'is_tsan=true' in vals['gn_args']
|
||||
cfi_diag = 'use_cfi_diag=true' in vals['gn_args']
|
||||
clang_coverage = 'use_clang_coverage=true' in vals['gn_args']
|
||||
java_coverage = 'use_jacoco_coverage=true' in vals['gn_args']
|
||||
javascript_coverage = 'use_javascript_coverage=true' in vals['gn_args']
|
||||
|
||||
test_type = isolate_map[target]['type']
|
||||
|
||||
if self.use_luci_auth:
|
||||
@ -1730,29 +1747,14 @@ class MetaBuildWrapper:
|
||||
# generated_scripts.
|
||||
cmdline += [script] + isolate_map[target].get('args', [])
|
||||
|
||||
if java_coverage:
|
||||
cmdline += ['--coverage-dir', '${ISOLATED_OUTDIR}/coverage']
|
||||
|
||||
return cmdline, []
|
||||
|
||||
|
||||
# TODO(crbug.com/816629): Convert all targets to generated_scripts
|
||||
# and delete the rest of this function.
|
||||
|
||||
# This should be true if tests with type='windowed_test_launcher' are
|
||||
# expected to run using xvfb. For example, Linux Desktop, X11 CrOS and
|
||||
# Ozone CrOS builds on Linux (xvfb is not used on CrOS HW or VMs). Note
|
||||
# that one Ozone build can be used to run different backends. Currently,
|
||||
# tests are executed for the headless and X11 backends and both can run
|
||||
# under Xvfb on Linux.
|
||||
use_xvfb = (self.platform.startswith('linux') and not is_android
|
||||
and not is_fuchsia and not is_cros_device)
|
||||
|
||||
asan = 'is_asan=true' in vals['gn_args']
|
||||
msan = 'is_msan=true' in vals['gn_args']
|
||||
tsan = 'is_tsan=true' in vals['gn_args']
|
||||
cfi_diag = 'use_cfi_diag=true' in vals['gn_args']
|
||||
clang_coverage = 'use_clang_coverage=true' in vals['gn_args']
|
||||
java_coverage = 'use_jacoco_coverage=true' in vals['gn_args']
|
||||
javascript_coverage = 'use_javascript_coverage=true' in vals['gn_args']
|
||||
|
||||
executable = isolate_map[target].get('executable', target)
|
||||
executable_suffix = isolate_map[target].get(
|
||||
'executable_suffix', '.exe' if is_win else '')
|
||||
|
Reference in New Issue
Block a user