From 79217e7e6318fbfb1bcb45da3a00d70e1a331935 Mon Sep 17 00:00:00 2001 From: Paul Ivanov Date: Thu, 8 May 2014 12:37:12 -0700 Subject: [PATCH] be explicit about skipping js tests this way those running the test suite can discover that there are a bunch of js test groups. New output of `iptest -j` looks like this ``` Test group: kernel.inprocess -------------------------------------- OK Test group: config ------------------------------------------------ OK Test group: extensions -------------------------------------------- OK Test group: lib --------------------------------------------------- OK Test group: testing ----------------------------------------------- OK Test group: core -------------------------------------------------- OK Test group: terminal ---------------------------------------------- OK Test group: utils ------------------------------------------------- OK Test group: kernel ------------------------------------------------ OK Test group: nbformat ---------------------------------------------- OK Test group: qt ---------------------------------------------------- OK Test group: autoreload -------------------------------------------- OK Test group: html -------------------------------------------------- OK Test group: nbconvert --------------------------------------------- OK Test group: parallel ----------------------------------------- NOT RUN Test group: js/base ------------------------------------------ NOT RUN Test group: js/notebook -------------------------------------- NOT RUN Test group: js/widgets --------------------------------------- NOT RUN Test group: js/tree ------------------------------------------ NOT RUN Test group: js/casperjs -------------------------------------- NOT RUN Test group: js/services -------------------------------------- NOT RUN ``` --- IPython/testing/iptestcontroller.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/IPython/testing/iptestcontroller.py b/IPython/testing/iptestcontroller.py index eb554e48c..df2957980 100644 --- a/IPython/testing/iptestcontroller.py +++ b/IPython/testing/iptestcontroller.py @@ -208,15 +208,17 @@ def get_js_test_dir(): def all_js_groups(): import glob test_dir = get_js_test_dir() - all_subdirs = glob.glob(test_dir + '*/') - return [js_prefix+os.path.relpath(x, test_dir) for x in all_subdirs if os.path.relpath(x, test_dir) != '__pycache__'] + all_subdirs = glob.glob(test_dir + '[!_]*/') + return [js_prefix+os.path.relpath(x, test_dir) for x in all_subdirs] class JSController(TestController): """Run CasperJS tests """ - def __init__(self, section): + requirements = ['zmq', 'tornado', 'jinja2', 'casperjs', 'sqlite3'] + def __init__(self, section, enabled=True): """Create new test runner.""" TestController.__init__(self) self.section = section + self.enabled = enabled js_test_dir = get_js_test_dir() includes = '--includes=' + os.path.join(js_test_dir,'util.js') test_cases = os.path.join(js_test_dir, self.section[len(js_prefix):]) @@ -244,7 +246,7 @@ class JSController(TestController): @property def will_run(self): - return all(have[a] for a in ['zmq', 'tornado', 'jinja2', 'casperjs', 'sqlite3']) + return self.enabled and all(have[a] for a in self.requirements) def _init_server(self): "Start the notebook server in a separate process" @@ -335,15 +337,15 @@ def prepare_controllers(options): js_testgroups = all_js_groups() else: js_testgroups = [g for g in testgroups if g not in py_testgroups] + js_enabled = len(js_testgroups) > 0 else: py_testgroups = py_test_group_names + js_testgroups = all_js_groups() if not options.all: - js_testgroups = [] + js_enabled = False test_sections['parallel'].enabled = False - else: - js_testgroups = all_js_groups() - c_js = [JSController(name) for name in js_testgroups] + c_js = [JSController(name, js_enabled) for name in js_testgroups] c_py = [PyTestController(name, options) for name in py_testgroups] controllers = c_py + c_js