Commit 86837e75 authored by Ben Joyce's avatar Ben Joyce Committed by Commit Bot

Add chrome_junit_test shard experimental test suit.

This introduces an experimental test suite that shards junit tests
to run faster.

This is to land after junit sharding lands:
https://chromium-review.googlesource.com/c/chromium/src/+/2490847

Bug: 1138506
Change-Id: I01e38a2e80686383e48908110815551ac5526e72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2493822
Commit-Queue: benjamin joyce <bjoyce@chromium.org>
Reviewed-by: default avatarPeter Wen <wnwen@chromium.org>
Reviewed-by: default avatarHaiyang Pan <hypan@google.com>
Cr-Commit-Position: refs/heads/master@{#823770}
parent 6cbffa8a
...@@ -228,8 +228,15 @@ def _GetTestClasses(file_path): ...@@ -228,8 +228,15 @@ def _GetTestClasses(file_path):
# TODO(crbug.com/1144077): Use robolectric buildconfig file arg. # TODO(crbug.com/1144077): Use robolectric buildconfig file arg.
if 'third_party/robolectric/' in test_jar: if 'third_party/robolectric/' in test_jar:
continue continue
test_classes += _GetTestClassesFromJar(
os.path.join(constants.DIR_SOURCE_ROOT, test_jar)) test_jar_path = os.path.join(constants.DIR_SOURCE_ROOT, test_jar)
# Bots write the classpath indexed from src.
if not os.path.exists(test_jar_path):
if test_jar.startswith('src' + os.path.sep):
test_jar_path = os.path.join(constants.DIR_SOURCE_ROOT, test_jar[4:])
test_classes += _GetTestClassesFromJar(test_jar_path)
logging.info('Found %d test classes in class_path jars.', len(test_classes)) logging.info('Found %d test classes in class_path jars.', len(test_classes))
return test_classes return test_classes
......
...@@ -1768,6 +1768,16 @@ ...@@ -1768,6 +1768,16 @@
"test": "chrome_junit_tests", "test": "chrome_junit_tests",
"test_id_prefix": "ninja://chrome/android:chrome_junit_tests/" "test_id_prefix": "ninja://chrome/android:chrome_junit_tests/"
}, },
{
"args": [
"--shards=6"
],
"experiment_percentage": 10,
"name": "chrome_junit_tests_with_shards",
"swarming": {},
"test": "chrome_junit_tests",
"test_id_prefix": "ninja://chrome/android:chrome_junit_tests/"
},
{ {
"name": "components_junit_tests", "name": "components_junit_tests",
"swarming": {}, "swarming": {},
...@@ -20680,6 +20690,16 @@ ...@@ -20680,6 +20690,16 @@
"test": "chrome_junit_tests", "test": "chrome_junit_tests",
"test_id_prefix": "ninja://chrome/android:chrome_junit_tests/" "test_id_prefix": "ninja://chrome/android:chrome_junit_tests/"
}, },
{
"args": [
"--shards=6"
],
"experiment_percentage": 10,
"name": "chrome_junit_tests_with_shards",
"swarming": {},
"test": "chrome_junit_tests",
"test_id_prefix": "ninja://chrome/android:chrome_junit_tests/"
},
{ {
"name": "components_junit_tests", "name": "components_junit_tests",
"swarming": {}, "swarming": {},
...@@ -29686,6 +29706,17 @@ ...@@ -29686,6 +29706,17 @@
"test": "chrome_junit_tests", "test": "chrome_junit_tests",
"test_id_prefix": "ninja://chrome/android:chrome_junit_tests/" "test_id_prefix": "ninja://chrome/android:chrome_junit_tests/"
}, },
{
"args": [
"--shards=6"
],
"experiment_percentage": 10,
"isolate_profile_data": true,
"name": "chrome_junit_tests_with_shards",
"swarming": {},
"test": "chrome_junit_tests",
"test_id_prefix": "ninja://chrome/android:chrome_junit_tests/"
},
{ {
"isolate_profile_data": true, "isolate_profile_data": true,
"name": "components_junit_tests", "name": "components_junit_tests",
...@@ -8316,6 +8316,16 @@ ...@@ -8316,6 +8316,16 @@
"test": "chrome_junit_tests", "test": "chrome_junit_tests",
"test_id_prefix": "ninja://chrome/android:chrome_junit_tests/" "test_id_prefix": "ninja://chrome/android:chrome_junit_tests/"
}, },
{
"args": [
"--shards=6"
],
"experiment_percentage": 10,
"name": "chrome_junit_tests_with_shards",
"swarming": {},
"test": "chrome_junit_tests",
"test_id_prefix": "ninja://chrome/android:chrome_junit_tests/"
},
{ {
"name": "components_junit_tests", "name": "components_junit_tests",
"swarming": {}, "swarming": {},
...@@ -7183,6 +7183,17 @@ ...@@ -7183,6 +7183,17 @@
"test": "chrome_junit_tests", "test": "chrome_junit_tests",
"test_id_prefix": "ninja://chrome/android:chrome_junit_tests/" "test_id_prefix": "ninja://chrome/android:chrome_junit_tests/"
}, },
{
"args": [
"--shards=6"
],
"experiment_percentage": 10,
"isolate_profile_data": true,
"name": "chrome_junit_tests_with_shards",
"swarming": {},
"test": "chrome_junit_tests",
"test_id_prefix": "ninja://chrome/android:chrome_junit_tests/"
},
{ {
"isolate_profile_data": true, "isolate_profile_data": true,
"name": "components_junit_tests", "name": "components_junit_tests",
...@@ -771,6 +771,13 @@ ...@@ -771,6 +771,13 @@
'base_junit_tests': {}, 'base_junit_tests': {},
'chrome_java_test_pagecontroller_junit_tests': {}, 'chrome_java_test_pagecontroller_junit_tests': {},
'chrome_junit_tests': {}, 'chrome_junit_tests': {},
'chrome_junit_tests_with_shards': {
'args': [
'--shards=6',
],
'test': 'chrome_junit_tests',
'experiment_percentage': 10,
},
'components_junit_tests': {}, 'components_junit_tests': {},
'content_junit_tests': {}, 'content_junit_tests': {},
'device_junit_tests': {}, 'device_junit_tests': {},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment