Skip to content

Commit

Permalink
Generating wrapper script for non-telemetry test migration to new rec…
Browse files Browse the repository at this point in the history
…ipe.

Refactored our execution of non-telemetry tests so we wouldn't have to generate
new isolates for every non-telemetry test during migration.  Instead you need
to just pass --migrated-test=true in the src  side json.

Also pulled out the perf script deps so we wouldn't have to update every time
the perf isolated script deps changed.

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_vr;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I27fac5c9a36f9321be80f0c60ab8b53eaefdc1c4
Reviewed-on: https://chromium-review.googlesource.com/995576
Reviewed-by: Ned Nguyen <nednguyen@google.com>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Commit-Queue: Emily Hanley <eyaich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548472}
  • Loading branch information
Emily Hanley authored and Commit Bot committed Apr 5, 2018
1 parent 77dddb8 commit 39a0031
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 113 deletions.
93 changes: 15 additions & 78 deletions chrome/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2136,13 +2136,8 @@ group("telemetry_perf_tests_experimental") {
"//tools/perf/:perf_experimental",
]

data = [
# Needed for isolate script to execute.
"//testing/scripts/common.py",
"//testing/xvfb.py",
"//testing/scripts/run_gtest_perf_test.py",
"//testing/scripts/run_performance_tests.py",
"//testing/scripts/run_telemetry_benchmark_as_googletest.py",
data_deps = [
"//testing:run_perf_test",
]
}

Expand All @@ -2154,10 +2149,8 @@ group("performance_test_suite") {
"//chrome/test:telemetry_perf_tests",
]

data = [
"//testing/scripts/run_performance_tests.py",
"//testing/scripts/run_gtest_perf_test.py",
"//testing/scripts/run_telemetry_benchmark_as_googletest.py",
data_deps = [
"//testing:run_perf_test",
]
}

Expand All @@ -2173,19 +2166,12 @@ group("telemetry_perf_webview_tests") {

group("angle_perftests") {
testonly = true
data_deps = [
"//testing:run_perf_test",
]
if (is_win || is_linux || is_android) {
data_deps = [
"//third_party/angle/src/tests:angle_perftests",
]
data_deps += [ "//third_party/angle/src/tests:angle_perftests" ]
}

data = [
# Needed for isolate script to execute.
"//testing/scripts/common.py",
"//testing/xvfb.py",
"//testing/scripts/run_gtest_perf_test.py",
"//tools/perf/generate_legacy_perf_dashboard_json.py",
]
}

if (is_mac) {
Expand Down Expand Up @@ -5070,12 +5056,10 @@ if (!is_android && !is_chromecast) {

data = [
"//chrome/test/data/extensions/api_test/",
]

# Needed for isolate script to execute.
"//testing/scripts/common.py",
"//testing/xvfb.py",
"//testing/scripts/run_gtest_perf_test.py",
"//tools/perf/generate_legacy_perf_dashboard_json.py",
data_deps = [
"//testing:run_perf_test",
]

if (is_win) {
Expand Down Expand Up @@ -5454,7 +5438,7 @@ if (!is_android && !is_fuchsia) {
}

# Executable to measure time to load libraries.
test("load_library_perf_tests_v2") {
test("load_library_perf_tests") {
sources = [
"../browser/load_library_perf_test.cc",
]
Expand All @@ -5472,65 +5456,18 @@ if (!is_android && !is_fuchsia) {
"//third_party/widevine/cdm:headers",
]

if (enable_library_cdms) {
deps += [ "//media/cdm:cdm_paths" ]
data_deps = [
"//media/cdm/library_cdm/clear_key_cdm",
"//third_party/widevine/cdm",
]
}

data = [
# Needed for isolate script to execute.
"//testing/scripts/common.py",
"//testing/xvfb.py",
"//testing/scripts/run_gtest_perf_test.py",
"//testing/scripts/run_performance_tests.py",
"//testing/scripts/run_telemetry_benchmark_as_googletest.py",
"//tools/perf/generate_legacy_perf_dashboard_json.py",
]

# This target should not require the Chrome executable to run.
assert_no_deps = [ "//chrome" ]
}

# Executable to measure time to load libraries.
test("load_library_perf_tests") {
sources = [
"../browser/load_library_perf_test.cc",
]

# This test deliberately does not depend in chrome's test support targets.
# This is a small test and Chrome's test support targets bring in the
# world, causing link time to explode. Please don't add more dependencies
# here without understanding how it affects link time (and factor them
# differently if possible).
deps = [
"//base/test:test_support_perf",
"//media:media_buildflags",
"//testing/gtest",
"//testing/perf",
"//third_party/widevine/cdm:headers",
data_deps = [
"//testing:run_perf_test",
]

if (enable_library_cdms) {
deps += [ "//media/cdm:cdm_paths" ]
data_deps = [
data_deps += [
"//media/cdm/library_cdm/clear_key_cdm",
"//third_party/widevine/cdm",
]
}

data = [
# Needed for isolate script to execute.
"//testing/scripts/common.py",
"//testing/xvfb.py",
"//testing/scripts/run_gtest_perf_test.py",
"//testing/scripts/run_performance_tests.py",
"//testing/scripts/run_telemetry_benchmark_as_googletest.py",
"//tools/perf/generate_legacy_perf_dashboard_json.py",
]

# This target should not require the Chrome executable to run.
assert_no_deps = [ "//chrome" ]
}
Expand Down
5 changes: 4 additions & 1 deletion testing/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ group("test_scripts_shared") {
]
}

group("run_gtest_perf_test") {
group("run_perf_test") {
data = [
"//testing/scripts/common.py",
"//testing/scripts/run_gtest_perf_test.py",
"//testing/scripts/run_performance_tests.py",
"//testing/scripts/run_performance_tests_wrapper.py",
"//testing/scripts/run_telemetry_benchmark_as_googletest.py",
"//tools/perf/generate_legacy_perf_dashboard_json.py",
]

Expand Down
64 changes: 54 additions & 10 deletions testing/buildbot/chromium.perf.fyi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
{
"args": [
"-v",
"--browser=android-chromium"
"--browser=android-chromium",
"--upload-results"
],
"isolate_name": "performance_test_suite",
"merge": {
Expand Down Expand Up @@ -450,21 +451,20 @@
"isolated_scripts": [
{
"args": [
"-v",
"--browser=release",
"--non-telemetry=true"
"--non-telemetry=true",
"--migrated-test=true"
],
"isolate_name": "load_library_perf_tests_v2",
"isolate_name": "load_library_perf_tests",
"merge": {
"args": [
"--service-account-file",
"/creds/service_accounts/service-account-chromium-perf-histograms.json"
],
"script": "//tools/perf/process_perf_results.py"
},
"name": "load_library_perf_tests_v2",
"name": "load_library_perf_tests",
"override_compile_targets": [
"load_library_perf_tests_v2"
"load_library_perf_tests"
],
"swarming": {
"can_use_on_swarming_builders": true,
Expand Down Expand Up @@ -495,7 +495,8 @@
{
"args": [
"-v",
"--browser=release"
"--browser=release",
"--upload-results"
],
"isolate_name": "performance_test_suite",
"merge": {
Expand Down Expand Up @@ -571,12 +572,55 @@
},
"One Buildbot Step Test Builder": {
"isolated_scripts": [
{
"args": [
"--non-telemetry=true",
"--migrated-test=true"
],
"isolate_name": "load_library_perf_tests",
"merge": {
"args": [
"--service-account-file",
"/creds/service_accounts/service-account-chromium-perf-histograms.json"
],
"script": "//tools/perf/process_perf_results.py"
},
"name": "load_library_perf_tests",
"override_compile_targets": [
"load_library_perf_tests"
],
"swarming": {
"can_use_on_swarming_builders": true,
"dimension_sets": [
{
"os": "Linux",
"pool": "Chrome-perf-fyi"
}
],
"expiration": 36000,
"hard_timeout": 36000,
"ignore_task_failure": false,
"io_timeout": 1800,
"shards": 1,
"upload_test_results": true
},
"trigger_script": {
"args": [
"--multiple-trigger-configs",
"[{\"id\": \"swarm823-c4\"}]",
"--multiple-dimension-script-verbose",
"True"
],
"script": "//testing/trigger_scripts/perf_device_trigger.py"
}
},
{
"args": [
"-v",
"--browser=reference",
"--xvfb",
"--testing=true"
"--upload-results",
"--testing=true",
"--xvfb"
],
"isolate_name": "telemetry_perf_tests_experimental",
"merge": {
Expand Down
15 changes: 3 additions & 12 deletions testing/buildbot/gn_isolate_map.pyl
Original file line number Diff line number Diff line change
Expand Up @@ -1146,16 +1146,7 @@
"load_library_perf_tests": {
"label": "//chrome/test:load_library_perf_tests",
"type": "script",
"script": "//testing/scripts/run_gtest_perf_test.py",
"args": [
"load_library_perf_tests",
"--test-launcher-print-test-stdio=always"
],
},
"load_library_perf_tests_v2": {
"label": "//chrome/test:load_library_perf_tests_v2",
"type": "script",
"script": "//testing/scripts/run_performance_tests.py",
"script": "//testing/scripts/run_performance_tests_wrapper.py",
"args": [
"load_library_perf_tests",
"--test-launcher-print-test-stdio=always"
Expand Down Expand Up @@ -1195,7 +1186,7 @@
"angle_perftests": {
"label": "//chrome/test:angle_perftests",
"type": "script",
"script": "//testing/scripts/run_gtest_perf_test.py",
"script": "//testing/scripts/run_performance_tests_wrapper.py",
"args": [
"angle_perftests",
"--test-launcher-print-test-stdio=always",
Expand All @@ -1216,7 +1207,7 @@
"performance_browser_tests": {
"label": "//chrome/test:performance_browser_tests",
"type": "script",
"script": "//testing/scripts/run_gtest_perf_test.py",
"script": "//testing/scripts/run_performance_tests_wrapper.py",
"args": [
"performance_browser_tests",
"--test-launcher-print-test-stdio=always",
Expand Down
40 changes: 40 additions & 0 deletions testing/scripts/run_performance_tests_wrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env python
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""This script is a wrapper script used during migration of performance
tests to use the new recipe. See crbug.com/757933
Non-telemetry tests now will all run with this script. The flag
--migrated-test will indicate if this test is using the new recipe or not.
By default this script runs the legacy testing/scripts/run_gtest_perf_test.py.
"""

import argparse
import os
import subprocess
import sys

SRC_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(
__file__))))

GTEST = os.path.join(SRC_DIR, 'testing', 'scripts', 'run_gtest_perf_test.py')
PERF = os.path.join(SRC_DIR, 'testing', 'scripts', 'run_performance_tests.py')


def main():
parser = argparse.ArgumentParser()
parser.add_argument('--migrated-test', type=bool, default=False)

args, rest_args = parser.parse_known_args()

if args.migrated_test:
return subprocess.call([sys.executable, PERF] + rest_args)
else:
return subprocess.call([sys.executable, GTEST] + rest_args)


if __name__ == '__main__':
sys.exit(main())
Loading

0 comments on commit 39a0031

Please sign in to comment.