diff options
author | Shing Lyu <shing.lyu@gmail.com> | 2016-11-09 14:55:57 +0800 |
---|---|---|
committer | Shing Lyu <shing.lyu@gmail.com> | 2016-12-01 10:23:27 +0800 |
commit | ddd03229e0f0247a7ffe1337025c4827a7851666 (patch) | |
tree | 358ccb2d6a64771786c4ea47627428bbee1126d2 /python/servo/testing_commands.py | |
parent | 16199b498367702561d4cae8eefb6e77f3fced3f (diff) | |
download | servo-ddd03229e0f0247a7ffe1337025c4827a7851666.tar.gz servo-ddd03229e0f0247a7ffe1337025c4827a7851666.zip |
Add an option to submit test-perf result to perfherder
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r-- | python/servo/testing_commands.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index a116a1eb804..5331fc4b757 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -166,12 +166,23 @@ class MachCommands(CommandBase): @Command('test-perf', description='Run the page load performance test', category='testing') - def test_perf(self): + @CommandArgument('--submit', default=False, action="store_true", + help="submit the data to perfherder") + def test_perf(self, submit=False): self.set_software_rendering_env(True) self.ensure_bootstrapped() env = self.build_env() - return call(["bash", "test_perf.sh"], + cmd = ["bash", "test_perf.sh"] + if submit: + if not ("TREEHERDER_CLIENT_ID" in os.environ and + "TREEHERDER_CLIENT_SECRET" in os.environ): + print("Please set the environment variable \"TREEHERDER_CLIENT_ID\"" + " and \"TREEHERDER_CLIENT_SECRET\" to submit the performance" + " test result to perfherder") + return 1 + cmd += ["--submit"] + return call(cmd, env=env, cwd=path.join("etc", "ci", "performance")) |