aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/testing_commands.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r--python/servo/testing_commands.py15
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"))