ipython/ipython — pull request #4285 by ivanov (2013-09-26 16:50:53+00:00)
Title: Notebook javascript test suite using CasperJS

With this PR, you can just `iptest js`, and if `casperjs` is found, and the
`ipython notebook` dependencies are met, the test suite will run. There are
still a couple of things left to polish off, but it works.

[X] write a test suite runner into our tools
[X] don't hardcode path to notebook server
[X] skip group if casper and phantomjs not found
[X] eliminate 2000 ms wait time in execute code

[ ] xunit is a possibility for casper, integrate that in to the controller configuration
[ ] document how to write new tests
[ ] (optional) make sure kernels actually shut down (they currently don't on failure)

@minrk's input on the following two would be great:

[ ] redirect stdout and stderr of the notebook server
[ ] AssertionError: Request closed
ERROR:tornado.application:Exception in callback
Traceback (most recent call last):
File "/home/pi/code/ipython-sloan/pyzmq/zmq/eventloop/minitornado/ioloop.py", line 463, in _run_callback
callback()
File "/home/pi/code/ipython-sloan/pyzmq/zmq/eventloop/minitornado/stack_context.py", line 331, in wrapped
raise_exc_info(exc)
File "/home/pi/code/ipython-sloan/pyzmq/zmq/eventloop/minitornado/stack_context.py", line 302, in wrapped
ret = fn(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/tornado/iostream.py", line 311, in wrapper
callback(*args)
File "/usr/lib/python2.7/dist-packages/tornado/httpserver.py", line 268, in _on_headers
self.request_callback(self._request)
File "/usr/lib/python2.7/dist-packages/tornado/web.py", line 1427, in __call__
handler._execute(transforms, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/tornado/web.py", line 1046, in _execute
self._handle_request_exception(e)
File "/usr/lib/python2.7/dist-packages/tornado/web.py", line 1086, in _handle_request_exception
self.send_error(500, exc_info=sys.exc_info())
File "/usr/lib/python2.7/dist-packages/tornado/web.py", line 741, in send_error
self.finish()
File "/usr/lib/python2.7/dist-packages/tornado/web.py", line 721, in finish
self.flush(include_footers=True)
File "/usr/lib/python2.7/dist-packages/tornado/web.py", line 681, in flush
self.request.write(headers + chunk, callback=callback)
File "/usr/lib/python2.7/dist-packages/tornado/httpserver.py", line 418, in write
self.connection.write(chunk, callback=callback)
File "/usr/lib/python2.7/dist-packages/tornado/httpserver.py", line 183, in write
assert self._request, "Request closed"
AssertionError: Request closed