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
Travis should run the js tests #801
Conversation
We should also try and have more up to date Mocha tests. |
how do we run them? I could add them to travis can you add a test that fails for testing purposes |
|
Also, I was just looking into adding the tests to travis... but I'm not sure how to do that. If you know, I'd be happy to re-assign... |
we need to run them outside the browser can we run them via nodejs at all? or some other command line thing? |
@tobes Yes, we should be able to run them via node. Lemme take a look and then I'll get back to you... |
Have a look at zombie http://zombie.labnotes.org. |
OK, I've got the front end tests running via the command line via mocha-phantomjs [1], it's essentially a mocha wrapper for phantomjs (which is a headerless node.js webkit browser). Here's what you'll need in order to get it to work:
Now the only issue is that you do require a CKAN instance to be running at http://localhost:5000 in order to complete a few of the tests (the test logic requires a call to the snippet API call to test against it's dom... but if we can't get this to work I think we just rewrite those tests) Also, as it stands that branch should error at: @domoritz Thanks for the tip... as you can see, I ended up going for something similar |
@johnmartin I made this a pr so that we can see what's happening on travis. Hope that's okay. |
…k but need to test on travis.
I was doing stuff on this but will stop as you are too I get 3 fails (I didn't start ckan) so this seems like easy enough to get working |
@tobes Are you talking to me? I also stopped doing stuff. |
I talk to anyone who will listen |
https://travis-ci.org/okfn/ckan/jobs/9219402 looks like travis ran the tests what we need is a failing test to check travis notices We also want to try to reduce the amount of noise
|
According to that travis job: yes all the node deps have been installed correctly. The three warnings are minor ones (which we don't need to worry about). Also, yes |
cool just do the installs before our ini file output, nosetests etc so we can ignore them we could do something like |
@tobes Perfect. This is good for review. Removing WIP. |
I still want the nosetests run last as that is least disruptive for the devs as then going to the end of the tests will show the same output that we are used to also the majority of peoples test errors will be python based as that is where the bulk of commits occur we will need to kill our test server before we run those tests though or we will have db locking issues/ port in use |
@tobes OK, I can move the mocha tests to a better place... however I don't know where to start with killing the |
did you add a test that fails just to test travis will pick it up |
@johnmartin ok the tests are running now. I'm working on getting travis to know the error happened. Hopefully my last commit will do this. |
fix the mocha test that was made to fail for testing This reverts commit dd46f25.
We have some JavaScript tests we should run these along with the python ones