Review comments

This commit is contained in:
Jonathan Frederic 2014-10-21 13:46:13 -07:00
parent c3b1bf795e
commit d33d55bcd8

View File

@ -15,12 +15,13 @@ import argparse
import json import json
import multiprocessing.pool import multiprocessing.pool
import os import os
import re
import requests
import shutil import shutil
import signal import signal
import sys import sys
import subprocess import subprocess
import time import time
import re
from .iptest import ( from .iptest import (
have, test_group_names as py_test_group_names, test_sections, StreamCapturer, have, test_group_names as py_test_group_names, test_sections, StreamCapturer,
@ -251,7 +252,15 @@ class JSController(TestController):
# If a url was specified, use that for the testing. # If a url was specified, use that for the testing.
if self.url: if self.url:
self.cmd.append("--url=%s" % self.url) try:
alive = requests.request('GET', self.url).status_code == 200
except:
alive = False
if alive:
self.cmd.append("--url=%s" % self.url)
else:
raise Exception('Could not reach "%s".' % self.url)
else: else:
# start the ipython notebook, so we get the port number # start the ipython notebook, so we get the port number
self.server_port = 0 self.server_port = 0
@ -646,7 +655,7 @@ argparser.add_argument('--all', action='store_true',
help='Include slow tests not run by default.') help='Include slow tests not run by default.')
argparser.add_argument('--slimerjs', action='store_true', argparser.add_argument('--slimerjs', action='store_true',
help="Use slimerjs if it's installed instead of phantomjs for casperjs tests.") help="Use slimerjs if it's installed instead of phantomjs for casperjs tests.")
argparser.add_argument('--url', const=None, default='', type=unicode, argparser.add_argument('--url', const=None, default='', type=str,
help="URL to use for the JS tests.") help="URL to use for the JS tests.")
argparser.add_argument('-j', '--fast', nargs='?', const=None, default=1, type=int, argparser.add_argument('-j', '--fast', nargs='?', const=None, default=1, type=int,
help='Run test sections in parallel. This starts as many ' help='Run test sections in parallel. This starts as many '