New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notebook javascript test suite using CasperJS #4285
Conversation
Hooray! |
:-) On Thu, Sep 26, 2013 at 10:07 AM, Min RK notifications@github.com wrote:
Brian E. Granger |
rebased on top of master |
Should we close #3125 ? |
|
||
The file `util.js` contains utility functions for tests, | ||
including a hardcoded path to a running notebook server | ||
(http://127.0.0.1:8888 by default). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should run the test suite using a notebook server on a different port than our default. Otherwise, if someone has a notebook server running already, the test suite would use it, potentially clobbering their notebooks. Pick some high random port number like 10345
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, that README was outdated, we actually grab a new port number as usual, and pass that along to the test suite
I love the look of this - I think that writing tests, with a bit more infrastructure in utils.py is going to be pretty nice. I should note that when I run the tests, I get lots of failures though. Is that expected or do you think it is a timing issue with the starting of the notebook server? |
There's a commit in here that will do that on merge. |
Glad to see this has been revived :-) I just realized that the code cell execution test fails in Python 3 because of the |
casper.notebook_test(function () { | ||
this.evaluate(function () { | ||
var cell = IPython.notebook.get_cell(0); | ||
cell.set_text('a=10; print a'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print(a)
First, this is really nice, I hope it will be merged soon :) I tried writing some new js tests. When tests fail, I get sometimes (but not always) the following traceback:
Nevertheless, the number of passed/failed tests is correct, so maybe this is not that important. |
as suggested by @ellisonbg in ipython#4285
@pablooliveira I'm also seeing these messages, trying to track down what's causing them, but you're definitely not alone |
ok, I've added some more tests here, including testing of interrupts via "mouse click" and via keyboard shortcuts. This took a while, since the combination of JavaScript, JQuery, CasperJS and phantomJS is a bit tricky to figure out who should be doing what... The uncaught exception stuff that @pablooliveira and I were seeing earlier are also gone now, and notebook kernels shutdown properly at the end of the tests. |
Paul - do you have any sense of whether it would be workable to backport the diffs to the 1.x branch? I tried a test merge of the 1.x branch against this branch and of course there were deltas all over the place. When we tried to run our notebook against IPython master branch the other week all kinds of things were unhappy so I don't think we can use the master branch as-is. |
I'm pretty sure this is not going to be backported to 1.x - that branch is only getting bugfixes. |
I'm willing to do the work myself, if Paul thinks that it is not too onerous. Our project needs front end testing over the next couple of months - but if it makes more sense to just code up a separate, lightweight CasperJS based test setup until until 2.0 gets into a release candidate form, I can go that route as well. |
I tried the quick and dirty test of just running the casperjs tests directly against a 1.x server, and they seem to function standalone (though about half of the tests seem to fail - but I can work with that), so I guess that seems adequate for now. |
@sychan yeah, it shouldn't be too bad to get this working against 1.x, Steve. After all, this is a continuation of work that was sitting in a PR pre 1.0 (7 months ago). |
Merging this now, people can keep adding tests in new branches. |
(actually, it needs a rebase) |
Markdown cell execution. Code cell test is based on https://gist.github.com/ellisonbg/3329929.
pressed in an empty notebook.
this line causes noise in the test suite, but if we just ignore it, we'll never get to the bottom of it. It seems to only happen when running 'iptest js', and *not* when running the 'casperjs test' command directly, with a notebookserver that was launched manually.
the PPA we use on Travis CI doesn't have CasperJS 1.1.0-DEV yet, so we're better off not using it for now.
Notebook javascript test suite using CasperJS
…so that they would run with the current 1.x branch. Currently passes the basic tests
as suggested by @ellisonbg in ipython#4285
Notebook javascript test suite using CasperJS
With this PR, you can just
iptest js
, and ifcasperjs
is found, and theipython notebook
dependencies are met, the test suite will run. There arestill a couple of things left to polish off, but it works.
closes #2292
--port=
command line argument when runningcasperjs test
directly-fast
flag is used (currently times out, due to slow startup, perhaps?)@minrk's input on the following two would be great:
--log-level=0
)