Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(534)

Side by Side Diff: mojo/tools/get_test_list.py

Issue 1421823002: Move performance dashboard upload logic to devtoolslib. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Move the argparse part too. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Central list of tests to run (as appropriate for a given config). Add tests 6 """Central list of tests to run (as appropriate for a given config). Add tests
7 to run by modifying this file. 7 to run by modifying this file.
8 8
9 Note that this file is both imported (by mojob.py) and run directly (via a 9 Note that this file is both imported (by mojob.py) and run directly (via a
10 recipe).""" 10 recipe)."""
11 11
12 12
13 import argparse 13 import argparse
14 import json 14 import json
15 import os 15 import os
16 import sys 16 import sys
17 17
18 from mopy.config import Config 18 from mopy.config import Config
19 from mopy.paths import Paths 19 from mopy.paths import Paths
20 20
21 # Url of the performance dashboard server to upload results of perftests to.
22 _PERFORMANCE_DASHBOARD_URL = "https://chromeperf.appspot.com"
23
21 24
22 def GetTestList(config, verbose_count=0): 25 def GetTestList(config, verbose_count=0):
23 """Gets the list of tests to run for the given config. The test list (which is 26 """Gets the list of tests to run for the given config. The test list (which is
24 returned) is just a list of dictionaries, each dictionary having two required 27 returned) is just a list of dictionaries, each dictionary having two required
25 fields: 28 fields:
26 { 29 {
27 "name": "Short name", 30 "name": "Short name",
28 "command": ["python", "test_runner.py", "--some", "args"] 31 "command": ["python", "test_runner.py", "--some", "args"]
29 } 32 }
30 """ 33 """
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 207
205 if target_os == Config.OS_LINUX and ShouldRunTest(Config.TEST_TYPE_PERF): 208 if target_os == Config.OS_LINUX and ShouldRunTest(Config.TEST_TYPE_PERF):
206 perf_id = "linux_%s" % ("debug" if config.is_debug else "release") 209 perf_id = "linux_%s" % ("debug" if config.is_debug else "release")
207 test_names = ["mojo_public_system_perftests", 210 test_names = ["mojo_public_system_perftests",
208 "mojo_public_bindings_perftests", 211 "mojo_public_bindings_perftests",
209 "mojo_system_perftests"] 212 "mojo_system_perftests"]
210 213
211 for test_name in test_names: 214 for test_name in test_names:
212 command = ["python", 215 command = ["python",
213 os.path.join("mojo", "tools", "perf_test_runner.py"), 216 os.path.join("mojo", "tools", "perf_test_runner.py"),
217 "--server-url", _PERFORMANCE_DASHBOARD_URL,
214 "--perf-id", perf_id, 218 "--perf-id", perf_id,
215 "--test-name", test_name, 219 "--test-name", test_name,
216 "--perf-data-path", 220 "--perf-data-path",
217 os.path.join(build_dir, test_name + "_perf.log"), 221 os.path.join(build_dir, test_name + "_perf.log")]
218 "--production-dashboard"]
219 if config.values.get("builder_name"): 222 if config.values.get("builder_name"):
220 command += ["--builder-name", config.values["builder_name"]] 223 command += ["--builder-name", config.values["builder_name"]]
221 if config.values.get("build_number"): 224 if config.values.get("build_number"):
222 command += ["--build-number", config.values["build_number"]] 225 command += ["--build-number", config.values["build_number"]]
223 if config.values.get("master_name"): 226 if config.values.get("master_name"):
224 command += ["--master-name", config.values["master_name"]] 227 command += ["--master-name", config.values["master_name"]]
225 command += [os.path.join(build_dir, test_name)] 228 command += [os.path.join(build_dir, test_name)]
226 229
227 AddEntry(test_name, command) 230 AddEntry(test_name, command)
228 231
(...skipping 26 matching lines...) Expand all
255 config = Config(**json.load(args.config_file)) 258 config = Config(**json.load(args.config_file))
256 test_list = GetTestList(config) 259 test_list = GetTestList(config)
257 json.dump(test_list, args.test_list_file, indent=2) 260 json.dump(test_list, args.test_list_file, indent=2)
258 args.test_list_file.write("\n") 261 args.test_list_file.write("\n")
259 262
260 return 0 263 return 0
261 264
262 265
263 if __name__ == "__main__": 266 if __name__ == "__main__":
264 sys.exit(main()) 267 sys.exit(main())
OLDNEW
« no previous file with comments | « mojo/devtools/common/devtoolslib/perf_dashboard.py ('k') | mojo/tools/mopy/perf_data_uploader.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698