Running socket.io-client tests

319 views
Skip to first unread message

Łukasz Rekucki

unread,
Mar 9, 2012, 7:31:14 PM3/9/12
to sock...@googlegroups.com
Hi,

I'm interested in contributing to socket.io, but I can't seem to run the tests for the client library. Here's what I'm doing:

1) I have a clean nodejs==0.6.12 install and a checkout of socket.io-client from github at version 0.9.1-1.
2) Following the wiki page I run "make test" - this shouts at me with "Error: Cannot find module 'express'". Ok, obviously I need to install dependencies, but it would
be nice to put this step on wiki. "npm install" installs a lot of stuff.
3) "Error: Cannot find module 'socket.io-client'" - ok, so I obviously don't know much about node packages, but "npm link" seems to fix this.
4) "Error: Cannot find module 'should'" - missing dependency. "npm install should"
5)

util.test.js parse uri: TypeError: Property 'should' of object http is not a function
    at Test.fn (/home/lrekucki/socket.io-client/test/util.test.js:17:21)
    at /home/lrekucki/socket.io-client/node_modules/expresso/bin/expresso:939:18
    at Test.setup (/home/lrekucki/socket.io-client/node_modules/expresso/bin/expresso:841:55)
    at Test.runSerial (/home/lrekucki/socket.io-client/node_modules/expresso/bin/expresso:937:10)
    at Test.run (/home/lrekucki/socket.io-client/node_modules/expresso/bin/expresso:921:18)
    at next (/home/lrekucki/socket.io-client/node_modules/expresso/bin/expresso:867:22)
    at runSuite (/home/lrekucki/socket.io-client/node_modules/expresso/bin/expresso:875:6)
    at check (/home/lrekucki/socket.io-client/node_modules/expresso/bin/expresso:814:12)
    at runFile (/home/lrekucki/socket.io-client/node_modules/expresso/bin/expresso:819:6)
    at next (/home/lrekucki/socket.io-client/node_modules/expresso/bin/expresso:792:17)

Patch in https://github.com/LearnBoost/socket.io-client/pull/364 fixes this. Comments there claim that it's my fault, as those tests
are supposed to be run in a browser. Fair enough, but why then wiki suggests running "make test" that runs them from node ? 
And of course the "test/node/builder.common.js" fails with some errors (maybe it's because the node version) both before and after the patch.

Sorry for the rant. If I can help out somehow, let me know.

Arnout Kazemier

unread,
Mar 10, 2012, 4:13:42 AM3/10/12
to sock...@googlegroups.com
When you clone stuff from github you always need to install the dependencies, this can just be done by typing in npm install . in the folder
and it would have installed all the required development dependencies.

You could have also just done `cat package.json` to see all the dependencies.
Also the wiki: https://github.com/LearnBoost/socket.io/wiki/Contributing says that make test is for the builder tests
and that make test-acceptance is for the browser tests.

Łukasz Rekucki

unread,
Mar 13, 2012, 9:21:45 AM3/13/12
to sock...@googlegroups.com


On Saturday, 10 March 2012 10:13:42 UTC+1, 3rdEden wrote:
When you clone stuff from github you always need to install the dependencies, this can just be done by typing in npm install . in the folder
and it would have installed all the required development dependencies.

I probably would do that first, if the wiki page mentioned that there are dependencies I need to install. The Socket.IO part mentions Redis, the client part doesn't mention any dependecies - it's not unreasonable that I could run tests just with standard library and what's bundled (many libraries meet that criteria). As mentioned earlier, I did 'npm install' and `make test` still raises errors. Maybe this is all obvious stuff to you, but if you want to have more contributors, you should really make the "Contributing" docs friendly.

 
Also the wiki: https://github.com/LearnBoost/socket.io/wiki/Contributing says that make test is for the builder tests
and that make test-acceptance is for the browser tests.

On Saturday, March 10, 2012 at 1:31 AM, Łukasz Rekucki wrote:

Great, so I should be able to run `make test` from the command-line and they should pass, right? Well, they don't because `should` is missing. But even if I install it, they fail as they are written for some old version (that after some searching seems to be bundled). But that's not really mentioned in the wiki page either, so it's another obstacle to contributing.

What I was trying to say is that the docs could be clearer on what *exactly* I need to do to run the tests from a clean checkout. That will really enhance the first experience with socket.io. Right now, the "builder tests" fail for me, so that's not a good sign too, but I don't know if it's because I didn't something wrong while setting it up or they just fail.

Guillermo Rauch

unread,
Mar 13, 2012, 9:45:32 AM3/13/12
to sock...@googlegroups.com
The client `make test` suite is not as important as `test-acceptance`. Focus on that one for the moment. I just noticed the `should` issue on `make test` (I usually run acceptance tests in all browsers for release)

2012/3/13 Łukasz Rekucki <lrek...@gmail.com>



--
Guillermo Rauch
LearnBoost CTO
http://devthought.com

Edward Barboza

unread,
Apr 19, 2012, 12:23:10 PM4/19/12
to sock...@googlegroups.com
I kind of got into the same situation as Lukasz, and installing every package one by one didnt help me (not really sure what I was missing). 

As you mentioned, doing a simple "npm install . " on the client's dir got it working perfectly fine. I agree that this could be added to the docs in case someone else runs into this :)
Reply all
Reply to author
Forward
0 new messages