Chromium Code Reviews| Index: mojo/tools/get_test_list.py |
| diff --git a/mojo/tools/get_test_list.py b/mojo/tools/get_test_list.py |
| index 0ee7a06293f004e910b77316bcd4b77710eb302b..b36d51ca7d172944df4431b5629a6b02a9d38463 100755 |
| --- a/mojo/tools/get_test_list.py |
| +++ b/mojo/tools/get_test_list.py |
| @@ -13,7 +13,9 @@ recipe).""" |
| import argparse |
| import json |
| import os |
| +import subprocess |
| import sys |
| +import urllib |
| from mopy.config import Config |
| from mopy.paths import Paths |
| @@ -21,11 +23,17 @@ from mopy.paths import Paths |
| def GetTestList(config): |
| """Gets the list of tests to run for the given config. The test list (which is |
| - returned) is just a list of dictionaries, each dictionary having two required |
| + returned) is just a list of dictionaries, each dictionary having the following |
| fields: |
| { |
| + # Required: |
| "name": "Short name", |
| "command": ["python", "test_runner.py", "--some", "args"] |
| + |
| + # Optional: |
| + "links": { |
|
viettrungluu
2015/01/28 01:51:45
I'm dubious about this having a dictionary value.
|
| + "Anchor text": "URL" |
| + } |
| } |
| """ |
| @@ -47,21 +55,29 @@ def GetTestList(config): |
| return not types_to_run.isdisjoint(this_tests_types) |
| # Call this to add the given command to the test list. |
| - def AddEntry(name, command): |
| + def AddEntry(name, command, links=None): |
| if config.sanitizer == Config.SANITIZER_ASAN: |
| command = (['python', os.path.join("mojo", "tools", |
| "run_command_through_symbolizer.py")] + |
| command) |
| - test_list.append({"name": name, "command": command}) |
| + entry = {"name": name, "command": command} |
| + if links is not None: |
| + entry["links"] = links |
| + test_list.append(entry) |
| # Call this to add the given command to the test list. If appropriate, the |
| # command will be run under xvfb. |
| - def AddXvfbEntry(name, command): |
| + def AddXvfbEntry(name, command, links=None): |
|
viettrungluu
2015/01/28 01:51:45
Just do **kwargs here.
|
| real_command = ["python"] |
| if config.target_os == Config.OS_LINUX: |
| real_command += ["./testing/xvfb.py", paths.SrcRelPath(paths.build_dir)] |
| real_command += command |
| - AddEntry(name, real_command) |
| + AddEntry(name, real_command, links) |
|
viettrungluu
2015/01/28 01:51:45
And here.
|
| + |
| + def GetCurrentCommitCount(): |
|
viettrungluu
2015/01/28 01:51:45
Please don't do this (actually run outside stuff,
|
| + return subprocess.check_output( |
| + ["git", "rev-list", "HEAD", "--count"]).strip() |
| + |
| # ---------------------------------------------------------------------------- |
| @@ -131,6 +147,7 @@ def GetTestList(config): |
| if target_os == Config.OS_LINUX and ShouldRunTest(Config.TEST_TYPE_PERF): |
| perf_id = "linux_%s" % ("debug" if config.is_debug else "release") |
| test_names = ["mojo_public_system_perftests"] |
| + point_id = GetCurrentCommitCount() |
| for test_name in test_names: |
| command = ["python", |
| @@ -139,6 +156,7 @@ def GetTestList(config): |
| "--test-name", test_name, |
| "--perf-data-path", |
| os.path.join(build_dir, test_name + "_perf.log"), |
| + "--point-id", point_id, |
| "--production-dashboard"] |
| if config.values.get("builder_name"): |
| command += ["--builder-name", config.values["builder_name"]] |
| @@ -148,7 +166,17 @@ def GetTestList(config): |
| command += ["--master-name", config.values["master_name"]] |
| command += [os.path.join(build_dir, test_name)] |
| - AddEntry(test_name, command) |
| + dashboard_params = urllib.urlencode({ |
| + "masters": config.values.get("master_name"), |
| + "bots": perf_id, |
| + "tests": test_name, |
| + "rev": point_id, |
| + }) |
| + links = { |
| + "Results Dashboard": ("https://chromeperf.appspot.com/report?%s" |
| + % dashboard_params) |
| + } |
| + AddEntry(test_name, command, links) |
|
viettrungluu
2015/01/28 01:51:45
You should use your kwarg as a kwarg, given that y
|
| # Integration tests ---------------------------------------------------------- |