Show More
@@ -15,12 +15,13 b' import argparse' | |||||
15 | import json |
|
15 | import json | |
16 | import multiprocessing.pool |
|
16 | import multiprocessing.pool | |
17 | import os |
|
17 | import os | |
|
18 | import re | |||
|
19 | import requests | |||
18 | import shutil |
|
20 | import shutil | |
19 | import signal |
|
21 | import signal | |
20 | import sys |
|
22 | import sys | |
21 | import subprocess |
|
23 | import subprocess | |
22 | import time |
|
24 | import time | |
23 | import re |
|
|||
24 |
|
25 | |||
25 | from .iptest import ( |
|
26 | from .iptest import ( | |
26 | have, test_group_names as py_test_group_names, test_sections, StreamCapturer, |
|
27 | have, test_group_names as py_test_group_names, test_sections, StreamCapturer, | |
@@ -251,8 +252,16 b' class JSController(TestController):' | |||||
251 |
|
252 | |||
252 | # If a url was specified, use that for the testing. |
|
253 | # If a url was specified, use that for the testing. | |
253 | if self.url: |
|
254 | if self.url: | |
|
255 | try: | |||
|
256 | alive = requests.request('GET', self.url).status_code == 200 | |||
|
257 | except: | |||
|
258 | alive = False | |||
|
259 | ||||
|
260 | if alive: | |||
254 | self.cmd.append("--url=%s" % self.url) |
|
261 | self.cmd.append("--url=%s" % self.url) | |
255 | else: |
|
262 | else: | |
|
263 | raise Exception('Could not reach "%s".' % self.url) | |||
|
264 | else: | |||
256 | # start the ipython notebook, so we get the port number |
|
265 | # start the ipython notebook, so we get the port number | |
257 | self.server_port = 0 |
|
266 | self.server_port = 0 | |
258 | self._init_server() |
|
267 | self._init_server() | |
@@ -646,7 +655,7 b" argparser.add_argument('--all', action='store_true'," | |||||
646 | help='Include slow tests not run by default.') |
|
655 | help='Include slow tests not run by default.') | |
647 | argparser.add_argument('--slimerjs', action='store_true', |
|
656 | argparser.add_argument('--slimerjs', action='store_true', | |
648 | help="Use slimerjs if it's installed instead of phantomjs for casperjs tests.") |
|
657 | help="Use slimerjs if it's installed instead of phantomjs for casperjs tests.") | |
649 |
argparser.add_argument('--url', const=None, default='', type= |
|
658 | argparser.add_argument('--url', const=None, default='', type=str, | |
650 | help="URL to use for the JS tests.") |
|
659 | help="URL to use for the JS tests.") | |
651 | argparser.add_argument('-j', '--fast', nargs='?', const=None, default=1, type=int, |
|
660 | argparser.add_argument('-j', '--fast', nargs='?', const=None, default=1, type=int, | |
652 | help='Run test sections in parallel. This starts as many ' |
|
661 | help='Run test sections in parallel. This starts as many ' |
General Comments 0
You need to be logged in to leave comments.
Login now