Commit 233df38a authored by Ashley Enstad's avatar Ashley Enstad Committed by Commit Bot

//tools/perf: Use trigger script in OBBS tester

Attempting to reland
https://chromium-review.googlesource.com/c/chromium/src/+/722067

Differences include: Not changing --id to --bot, removing the sys.executable as an argument to the subprocess, and changing --dump_json to --dump-json

BUG=chromium:758632

Change-Id: I91bad09256a7e87972c448039c89e308ee5db7f5
Reviewed-on: https://chromium-review.googlesource.com/747074Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Reviewed-by: default avatarStephen Martinis <martiniss@chromium.org>
Commit-Queue: Ashley Enstad <ashleymarie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512909}
parent 09afc263
...@@ -83,8 +83,6 @@ ...@@ -83,8 +83,6 @@
"isolated_scripts": [ "isolated_scripts": [
{ {
"args": [ "args": [
"--bot",
"swarm823-c4",
"--builder", "--builder",
"One Buildbot Step Test Builder", "One Buildbot Step Test Builder",
"-v", "-v",
...@@ -102,7 +100,6 @@ ...@@ -102,7 +100,6 @@
"can_use_on_swarming_builders": true, "can_use_on_swarming_builders": true,
"dimension_sets": [ "dimension_sets": [
{ {
"id": "swarm823-c4",
"pool": "Chrome-perf-fyi" "pool": "Chrome-perf-fyi"
} }
], ],
...@@ -110,6 +107,17 @@ ...@@ -110,6 +107,17 @@
"hard_timeout": 10800, "hard_timeout": 10800,
"ignore_task_failure": false, "ignore_task_failure": false,
"io_timeout": 3600 "io_timeout": 3600
},
"trigger_script": {
"args": [
"--bot-id",
"swarm823-c4",
"--bot-id",
"swarm846-c4",
"--bot-id",
"swarm847-c4"
],
"script": "//tools/perf/perf_device_trigger.py"
} }
} }
] ]
......
...@@ -85,7 +85,6 @@ ...@@ -85,7 +85,6 @@
"isolated_scripts": [ "isolated_scripts": [
{ {
"args": [ "args": [
"--bot", "swarm823-c4",
"--builder", "One Buildbot Step Test Builder", "--builder", "One Buildbot Step Test Builder",
"-v", "-v",
"--output-format=histograms", "--output-format=histograms",
...@@ -102,7 +101,6 @@ ...@@ -102,7 +101,6 @@
"can_use_on_swarming_builders": true, "can_use_on_swarming_builders": true,
"dimension_sets": [ "dimension_sets": [
{ {
"id": "swarm823-c4",
"pool": "Chrome-perf-fyi" "pool": "Chrome-perf-fyi"
} }
], ],
...@@ -110,6 +108,14 @@ ...@@ -110,6 +108,14 @@
"hard_timeout": 10800, "hard_timeout": 10800,
"ignore_task_failure": false, "ignore_task_failure": false,
"io_timeout": 3600 "io_timeout": 3600
},
"trigger_script": {
"script": "//tools/perf/perf_device_trigger.py",
"args": [
"--bot-id", "swarm823-c4",
"--bot-id", "swarm846-c4",
"--bot-id", "swarm847-c4"
]
} }
} }
] ]
......
...@@ -51,8 +51,8 @@ def modify_args(all_args, bot_id, temp_file): ...@@ -51,8 +51,8 @@ def modify_args(all_args, bot_id, temp_file):
dash_ind = all_args.index('--') dash_ind = all_args.index('--')
return all_args[:dash_ind] + [ return all_args[:dash_ind] + [
'--dump_json', temp_file, '--dimension', 'id', bot_id] + all_args[ '--dump-json', temp_file, '--dimension', 'id', bot_id] + all_args[
dash_ind:] + ['--bot', bot_id] dash_ind:] + ['--id', bot_id]
def trigger_tasks(args, remaining): def trigger_tasks(args, remaining):
...@@ -75,8 +75,7 @@ def trigger_tasks(args, remaining): ...@@ -75,8 +75,7 @@ def trigger_tasks(args, remaining):
try: try:
args_to_pass = modify_args(remaining[:], bot_id, json_temp) args_to_pass = modify_args(remaining[:], bot_id, json_temp)
ret = subprocess.call( ret = subprocess.call([get_swarming_py_path()] + args_to_pass)
sys.executable, [get_swarming_py_path()] + args_to_pass)
if ret: if ret:
sys.stderr.write('Failed to trigger a task, aborting\n') sys.stderr.write('Failed to trigger a task, aborting\n')
return ret return ret
......
...@@ -6,7 +6,6 @@ import json ...@@ -6,7 +6,6 @@ import json
import os import os
import tempfile import tempfile
import unittest import unittest
import sys
import mock import mock
...@@ -40,9 +39,8 @@ class PerfDeviceTriggerUnittest(unittest.TestCase): ...@@ -40,9 +39,8 @@ class PerfDeviceTriggerUnittest(unittest.TestCase):
called_args, keyword = call_mock.call_args called_args, keyword = call_mock.call_args
self.assertEqual(keyword, {}) self.assertEqual(keyword, {})
self.assertEqual(called_args[0], sys.executable) python_args = called_args[0]
python_args = called_args[1] json_ind = python_args.index('--dump-json')
json_ind = python_args.index('--dump_json')
# Remove --dump_json and its arg # Remove --dump_json and its arg
python_args.pop(json_ind) python_args.pop(json_ind)
temp_json_path = python_args.pop(json_ind) temp_json_path = python_args.pop(json_ind)
...@@ -59,7 +57,7 @@ class PerfDeviceTriggerUnittest(unittest.TestCase): ...@@ -59,7 +57,7 @@ class PerfDeviceTriggerUnittest(unittest.TestCase):
'/path/to/swarming.py', 'trigger', '/path/to/swarming.py', 'trigger',
'--some', '--test', '--some', '--test',
'--dimension', 'id', 'build1', '--', '--dimension', 'id', 'build1', '--',
'args', '--bot', 'build1']) 'args', '--id', 'build1'])
finally: finally:
os.close(temp_fd) os.close(temp_fd)
os.remove(json_temp) os.remove(json_temp)
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