diff options
author | Shing Lyu <slyu@mozilla.com> | 2017-01-10 16:48:54 +0800 |
---|---|---|
committer | Shing Lyu <slyu@mozilla.com> | 2017-01-12 11:39:24 +0800 |
commit | d8501badc07aa6cb0fe2b3f216bc3c7abbda715f (patch) | |
tree | 1da6bcdc6b5c8799e000cc39bf0cc5ee7f53ab74 /etc/ci/performance/gecko_driver.py | |
parent | 9d320d5a34fe9911266940eb1ce96204d345b678 (diff) | |
download | servo-d8501badc07aa6cb0fe2b3f216bc3c7abbda715f.tar.gz servo-d8501badc07aa6cb0fe2b3f216bc3c7abbda715f.zip |
Read firefox path from environment variable for performance test
Diffstat (limited to 'etc/ci/performance/gecko_driver.py')
-rw-r--r-- | etc/ci/performance/gecko_driver.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/etc/ci/performance/gecko_driver.py b/etc/ci/performance/gecko_driver.py index f8772a81c6f..fe1450d1d1c 100644 --- a/etc/ci/performance/gecko_driver.py +++ b/etc/ci/performance/gecko_driver.py @@ -6,13 +6,22 @@ from contextlib import contextmanager import json +import os from selenium import webdriver from selenium.common.exceptions import TimeoutException +import sys @contextmanager def create_gecko_session(): - firefox_binary = "./firefox/firefox/firefox" + try: + firefox_binary = os.environ['FIREFOX_BIN'] + except KeyError: + print("+=============================================================+") + print("| You must set the path to your firefox binary to FIREFOX_BIN |") + print("+=============================================================+") + sys.exit() + driver = webdriver.Firefox(firefox_binary=firefox_binary) yield driver # driver.quit() gives an "'NoneType' object has no attribute 'path'" error. @@ -90,6 +99,7 @@ def run_gecko_test(testcase, timeout): return [timings] + if __name__ == '__main__': # Just for manual testing from pprint import pprint |