Commit a6e6b04f a6e6b04f609fa5d207f0e29a7793a69fa1294d6b by Laurent Jouanneau

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.
1 parent 35ac717c
...@@ -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
......