clitests: Fixes issue with phantomjs path
In travis environment, PHANTOMJS_EXECUTABLE contains a relative path to phantomjs executable. However, new tests change the working directory, so this path becomes invalid. We should set PHANTOMJS_EXECUTABLE to an absolute path.
Showing
1 changed file
with
5 additions
and
1 deletions
... | @@ -9,7 +9,11 @@ import unittest | ... | @@ -9,7 +9,11 @@ import unittest |
9 | TEST_ROOT = os.path.abspath(os.path.dirname(__file__)) | 9 | TEST_ROOT = os.path.abspath(os.path.dirname(__file__)) |
10 | CASPERJS_ROOT = os.path.abspath(os.path.join(TEST_ROOT, '..', '..')) | 10 | CASPERJS_ROOT = os.path.abspath(os.path.join(TEST_ROOT, '..', '..')) |
11 | CASPER_EXEC = os.path.join(CASPERJS_ROOT, 'bin', 'casperjs') | 11 | CASPER_EXEC = os.path.join(CASPERJS_ROOT, 'bin', 'casperjs') |
12 | 12 | PHANTOMJS_EXEC = os.environ['PHANTOMJS_EXECUTABLE'] | |
13 | # make it to an absolute path, because some test change the working directory | ||
14 | # and relative path to phantomjs would be invalid | ||
15 | if not os.path.isabs(PHANTOMJS_EXEC): | ||
16 | os.environ['PHANTOMJS_EXECUTABLE'] = os.path.join(CASPERJS_ROOT, PHANTOMJS_EXEC) | ||
13 | 17 | ||
14 | class TimeoutException(Exception): | 18 | class TimeoutException(Exception): |
15 | pass | 19 | pass | ... | ... |
-
Please register or sign in to post a comment