Skip to content

Commit

Permalink
Add views_perftests to the CQ and Waterfall (before adding to perf bots)
Browse files Browse the repository at this point in the history
views_perftests run like cc_perftests. However, they need xvfb.

cc_perftests uses run_gtest_perf_test.py. However, its xvfb support has
been broken since r434762 which removed should_start_xvfb and other things.

run_telemetry_benchmark_as_googletest.py was fixed to cater for this
change in r491092. However, the same fix does not work for
run_gtest_perf_test.py because the helper in xvfb.py does not allow
stdout to redirect to a file, which is needed for the perf chart json
output.

Update xvfb.py to support this. However, having xvfb.py depend on
scripts/common.py creates a mess, so resolve by moving the
run_command_with_output() wrapper from testing/scripts/common.py to
testing/test_env.py. Nothing else is using it.

Start wrapping these test scripts in a proper gn target in testing/BUILD.gn
to avoid the same list appearing in dozens of places. However, this exposes
testing/BUILD.gn to the `gn check` graph, which requires fixing a silent
dependency that lots of test targets have on //testing/gmock_mutant.

Bug: 785522
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I413b642d53a8a6c8f8cc5326ff47e899b36abd37
Reviewed-on: https://chromium-review.googlesource.com/848466
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531789}
  • Loading branch information
tapted authored and Commit Bot committed Jan 25, 2018
1 parent b8d8c34 commit b185243
Show file tree
Hide file tree
Showing 15 changed files with 244 additions and 90 deletions.
20 changes: 20 additions & 0 deletions testing/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,23 @@ source_set("gmock_mutant") {
"//base",
]
}

# Targets needed for isolate script to execute.
group("test_scripts_shared") {
data = [
"//testing/test_env.py",
"//testing/xvfb.py",
]
}

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

data_deps = [
":test_scripts_shared",
]
}
7 changes: 7 additions & 0 deletions testing/buildbot/chromium.clang.json
Original file line number Diff line number Diff line change
Expand Up @@ -7579,6 +7579,13 @@
"shards": 4
}
},
{
"isolate_name": "views_perftests",
"name": "views_perftests",
"swarming": {
"can_use_on_swarming_builders": true
}
},
{
"isolate_name": "webkit_python_tests",
"name": "webkit_python_tests",
Expand Down
21 changes: 21 additions & 0 deletions testing/buildbot/chromium.fyi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1718,6 +1718,13 @@
"can_use_on_swarming_builders": false
}
},
{
"isolate_name": "views_perftests",
"name": "views_perftests",
"swarming": {
"can_use_on_swarming_builders": false
}
},
{
"isolate_name": "webkit_python_tests",
"name": "webkit_python_tests",
Expand Down Expand Up @@ -2346,6 +2353,13 @@
"shards": 4
}
},
{
"isolate_name": "views_perftests",
"name": "views_perftests",
"swarming": {
"can_use_on_swarming_builders": true
}
},
{
"isolate_name": "webkit_layout_tests_exparchive",
"merge": {
Expand Down Expand Up @@ -6024,6 +6038,13 @@
"shards": 2
}
},
{
"isolate_name": "views_perftests",
"name": "views_perftests",
"swarming": {
"can_use_on_swarming_builders": true
}
},
{
"isolate_name": "webkit_python_tests",
"name": "webkit_python_tests",
Expand Down
21 changes: 21 additions & 0 deletions testing/buildbot/chromium.linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -1276,6 +1276,13 @@
"shards": 4
}
},
{
"isolate_name": "views_perftests",
"name": "views_perftests",
"swarming": {
"can_use_on_swarming_builders": true
}
},
{
"isolate_name": "webkit_layout_tests_exparchive",
"merge": {
Expand Down Expand Up @@ -1977,6 +1984,13 @@
"shards": 4
}
},
{
"isolate_name": "views_perftests",
"name": "views_perftests",
"swarming": {
"can_use_on_swarming_builders": true
}
},
{
"isolate_name": "webkit_python_tests",
"name": "webkit_python_tests",
Expand Down Expand Up @@ -2456,6 +2470,13 @@
"shards": 4
}
},
{
"isolate_name": "views_perftests",
"name": "views_perftests",
"swarming": {
"can_use_on_swarming_builders": true
}
},
{
"isolate_name": "webkit_python_tests",
"name": "webkit_python_tests",
Expand Down
35 changes: 35 additions & 0 deletions testing/buildbot/chromium.mac.json
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,13 @@
"shards": 4
}
},
{
"isolate_name": "views_perftests",
"name": "views_perftests",
"swarming": {
"can_use_on_swarming_builders": true
}
},
{
"isolate_name": "webkit_layout_tests_exparchive",
"merge": {
Expand Down Expand Up @@ -862,6 +869,13 @@
"shards": 4
}
},
{
"isolate_name": "views_perftests",
"name": "views_perftests",
"swarming": {
"can_use_on_swarming_builders": true
}
},
{
"isolate_name": "webkit_layout_tests_exparchive",
"merge": {
Expand Down Expand Up @@ -1299,6 +1313,13 @@
"shards": 4
}
},
{
"isolate_name": "views_perftests",
"name": "views_perftests",
"swarming": {
"can_use_on_swarming_builders": true
}
},
{
"isolate_name": "webkit_layout_tests_exparchive",
"merge": {
Expand Down Expand Up @@ -1752,6 +1773,13 @@
"shards": 4
}
},
{
"isolate_name": "views_perftests",
"name": "views_perftests",
"swarming": {
"can_use_on_swarming_builders": true
}
},
{
"isolate_name": "webkit_python_tests",
"name": "webkit_python_tests",
Expand Down Expand Up @@ -2175,6 +2203,13 @@
"shards": 4
}
},
{
"isolate_name": "views_perftests",
"name": "views_perftests",
"swarming": {
"can_use_on_swarming_builders": true
}
},
{
"isolate_name": "webkit_python_tests",
"name": "webkit_python_tests",
Expand Down
7 changes: 7 additions & 0 deletions testing/buildbot/chromium.sandbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,13 @@
"shards": 4
}
},
{
"isolate_name": "views_perftests",
"name": "views_perftests",
"swarming": {
"can_use_on_swarming_builders": true
}
},
{
"isolate_name": "webkit_layout_tests_exparchive",
"merge": {
Expand Down
21 changes: 21 additions & 0 deletions testing/buildbot/chromium.win.json
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,13 @@
"shards": 4
}
},
{
"isolate_name": "views_perftests",
"name": "views_perftests",
"swarming": {
"can_use_on_swarming_builders": true
}
},
{
"isolate_name": "webkit_python_tests",
"name": "webkit_python_tests",
Expand Down Expand Up @@ -1747,6 +1754,13 @@
"shards": 4
}
},
{
"isolate_name": "views_perftests",
"name": "views_perftests",
"swarming": {
"can_use_on_swarming_builders": true
}
},
{
"isolate_name": "webkit_python_tests",
"name": "webkit_python_tests",
Expand Down Expand Up @@ -2276,6 +2290,13 @@
"shards": 4
}
},
{
"isolate_name": "views_perftests",
"name": "views_perftests",
"swarming": {
"can_use_on_swarming_builders": true
}
},
{
"args": [
"--debug",
Expand Down
9 changes: 9 additions & 0 deletions testing/buildbot/gn_isolate_map.pyl
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,15 @@
"label": "//ui/views/mus:views_mus_unittests",
"type": "windowed_test_launcher",
},
"views_perftests": {
"label": "//ui/views:views_perftests",
"type": "script",
"script": "//testing/scripts/run_gtest_perf_test.py",
"args": [
"--xvfb",
"views_perftests",
],
},
"views_unittests": {
"label": "//ui/views:views_unittests",
"type": "windowed_test_launcher",
Expand Down
1 change: 1 addition & 0 deletions testing/buildbot/test_suites.pyl
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,7 @@
'shards': 4,
},
},
'views_perftests': {},
'webkit_layout_tests': {
'isolate_name': 'webkit_layout_tests_exparchive',
'merge': {
Expand Down
6 changes: 6 additions & 0 deletions testing/gmock/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ source_set("gmock") {
"//third_party/googletest:gmock",
]

# Allow Chromium targets depending on gmock to #include testing/gmock_mutant.h
# without triggering a `gn check` error.
public_deps = [
"//testing:gmock_mutant",
]

public_configs = [
"//third_party/googletest:gmock_config",
"//third_party/googletest:gtest_config",
Expand Down
18 changes: 0 additions & 18 deletions testing/scripts/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,24 +73,6 @@ def run_command(argv, env=None, cwd=None):
return rc


def run_command_with_output(argv, stdoutfile, env=None, cwd=None):
""" Run command and stream its stdout/stderr to the console & |stdoutfile|.
"""
print 'Running %r in %r (env: %r)' % (argv, cwd, env)
assert stdoutfile
with io.open(stdoutfile, 'w') as writer, io.open(stdoutfile, 'r', 1) as \
reader:
process = subprocess.Popen(argv, env=env, cwd=cwd, stdout=writer,
stderr=subprocess.STDOUT)
while process.poll() is None:
sys.stdout.write(reader.read())
time.sleep(0.1)
# Read the remaining
sys.stdout.write(reader.read())
print 'Command %r returned exit code %d' % (argv, process.returncode)
return process.returncode


def run_runtest(cmd_args, runtest_args):
env = os.environ.copy()
env['CHROME_HEADLESS'] = '1'
Expand Down
Loading

0 comments on commit b185243

Please sign in to comment.