Closed paul90 closed 9 years ago
The first test is easily fixed by doing a bit of cross platform coding.
The rest all appear to be due to the test client getting a response to say it is not authorized to write to the server, but the updates appear to get written to the file system. :confused:
Confirm similar test failings on fresh clone in Ubuntu 14.04:
10 passing (20s)
10 failing
1) page #page.get() should copy a page from plugins if nonexistant in db:
Error: timeout of 2000ms exceeded
at null.<anonymous> (/home/ryan/git/wiki/wiki-node-server/node_modules/mocha/lib/runnable.js:139:19)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
2) page #page.get() should create a page if it exists nowhere:
Error: timeout of 2000ms exceeded
at null.<anonymous> (/home/ryan/git/wiki/wiki-node-server/node_modules/mocha/lib/runnable.js:139:19)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
3) page #page.get() should eventually write the page to disk:
Error: timeout of 2000ms exceeded
at null.<anonymous> (/home/ryan/git/wiki/wiki-node-server/node_modules/mocha/lib/runnable.js:139:19)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
4) server #actionCB() should create a page:
Error: timeout of 2000ms exceeded
at null.<anonymous> (/home/ryan/git/wiki/wiki-node-server/node_modules/mocha/lib/runnable.js:139:19)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
5) server #actionCB() should move the paragraphs to the order given :
Error: timeout of 2000ms exceeded
at null.<anonymous> (/home/ryan/git/wiki/wiki-node-server/node_modules/mocha/lib/runnable.js:139:19)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
6) server #actionCB() should add a paragraph:
Error: timeout of 2000ms exceeded
at null.<anonymous> (/home/ryan/git/wiki/wiki-node-server/node_modules/mocha/lib/runnable.js:139:19)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
7) server #actionCB() should remove a paragraph with given id:
Error: timeout of 2000ms exceeded
at null.<anonymous> (/home/ryan/git/wiki/wiki-node-server/node_modules/mocha/lib/runnable.js:139:19)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
8) server #actionCB() should edit a paragraph in place:
Error: timeout of 2000ms exceeded
at null.<anonymous> (/home/ryan/git/wiki/wiki-node-server/node_modules/mocha/lib/runnable.js:139:19)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
9) server #actionCB() should default to no change:
Error: timeout of 2000ms exceeded
at null.<anonymous> (/home/ryan/git/wiki/wiki-node-server/node_modules/mocha/lib/runnable.js:139:19)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
10) server #actionCB() should refuse to create over a page:
Error: timeout of 2000ms exceeded
at null.<anonymous> (/home/ryan/git/wiki/wiki-node-server/node_modules/mocha/lib/runnable.js:139:19)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
npm ERR! Test failed. See above for more details.
npm ERR! not ok code 0
I'm also getting no luck from a behavioral test: requests for nonexistent pages just hang on the client end. Chrome dev tools confirm GET request, but no response (not even a 404). it's more than possible I'm just overlooking something since last time I hacked on wiki though.
Update: upon some inspection, I found my fresh install woes were coming from patch resolution that wasn't happening correctly due to using 'npm link' to get the server code called in the wiki-node directory. not entirely sure how to fix...
Ryan, thanks for looking.
I've never quite trusted 'npm link' having had links disappear and not noticed. Much rather use 'npm install' with a path, but have started noticing cache issues. So, now I also remove the package from the cache once it's installed.
that seems reasonable.
My use of 'npm link' is heavily influenced by the fact that I NEVER get anything right the first try, so running npm install against a local directory is something that would get tedious very fast for the number of times I change a dependency for the sake of a dependent that I'm also working on.
I suppose I should note for posterity that my working solution here is to instanstiate ./bin/server.js in wiki node with the -r flag set to the path of my npm linked wiki-node-server, rather than to where it actually lives, this seems to get me off the ground.
I clone a fresh copy of wiki-node-server from master, npm installed, and ran npm test. My results are similar, 10 passing, 10 failing. Can anyone remember when these tests last ran? I was embarrassed to admit to @nrn that I didn't even know they were here and had not been running npm test when I dabbled in the node code.
Caused by there being no plugins when testing, and this not being captured in file.io
in page.coffee
.
Fixed as part of the Express 4 upgrade, by detecting that the no plugins and return Page not found
.
Spotted while doing a little tidy (see #59).
Running the tests,
npm test
, on Windows do not pass.While the first is to be expected, the others all fail due to timeout.
Is this just an issue on Windows, or does this problem exist on other platforms?