Friday, August 19, 2011

Broken Vows in Node-SPDY

‹prev | My Chain | next›

For some reason tonight, I give the test suite in node-spdy a try. This was greeted with the following:
➜  node-spdy  node test/spdy-basic-test.js

✗ Errored » callback not fired
in spdy.createServer
in SPDY/basic test
in undefined✗ Errored » 1 errored ∙ 1 dropped
I am unsure what could have changed to break the vows.js between the last release of node-spdy. Hopefully it wasn't my changes last night.

Checking things out with node 0.5.3 (instead of edge node 0.5.5), I see that the suite is still passing:
➜  node-spdy  vows --spec test/spdy-basic-test.js

♢ SPDY/basic test

spdy.createServer
✓ should return spdy.Server instance
Listening on this server instance
✓ should be successfull
Calling spdy.createZLib
✓ should return instance of spdy.ZLib
Creating new connection to this server
✓ should receive connect event
Creating parser and waiting for SYN_REPLY
✓ should end up w/ that frame
Sending control SYN_STREAM frame should be successfull and sending request body
✓ should emit data and end events on request
Creating parser and waiting for Data packet
✓ should end up w/ that frame
When calling server.close
✓ all connections will be dropped

✓ OK » 8 honored (0.038s)
Just to be 100% certain that I had not messed up earlier by installing different versions of vows locally and globally or something else along those lines, I reinstall the latest against node 0.5.5 locally:
➜  node-spdy  npm install vows
vows@0.5.10 ./node_modules/vows
└── eyes@0.1.6
...and globally:
➜  node-spdy  npm install vows -g
/home/cstrom/local/node-v0.5.5/bin/vows -> /home/cstrom/local/node-v0.5.5/lib/node_modules/vows/bin/vows
eyes@0.1.6 /home/cstrom/local/node-v0.5.5/lib/node_modules/vows/node_modules/eyes
vows@0.5.10 /home/cstrom/local/node-v0.5.5/lib/node_modules/vows
And still, when I run my tests, I find:
➜  node-spdy  vows --spec ./test/spdy-basic-test.js

♢ SPDY/basic test


✗ Errored » callback not fired
in spdy.createServer
in SPDY/basic test
in test/spdy-basic-test.js
✗ Errored » 1 errored ∙ 1 dropped
Hrm... that callback not fired message used to only apply to tests that have a return value. There is definitely not a return value in "SPDY/basic test":
vows.describe('SPDY/basic test').addBatch({
'spdy.createServer': {
topic: function() {
return spdy.createServer(options);
},
    'should return spdy.Server instance': function (_server) {
assert.instanceOf(_server, spdy.Server);
server = _server;
}
}
}).addBatch({
// ...
Even stranger is that the "callback not fired" message seems to be coming from the vows topic, not the test itself.

My next step is to boil down the batch to absolute basics:
vows.describe('SPDY/basic test').addBatch({
'spdy.createServer': {
topic: spdy.createServer(options),
'should return spdy.Server instance': function (_server) {
      console.log("*****")
assert.equal(42, 42);
}
}
}).export(module);
Still it fails. And still, it is not making it into the actual vow.

Next, I replace the vows being used with a local copy of the github clone:
➜  ~  cd ~/repos
➜  repos  git clone https://github.com/cloudhead/vows.git
Cloning into vows...
➜  repos  cd vows
➜  vows git:(master) npm install eyes
eyes@0.1.6 ./node_modules/eyes

➜  vows git:(master) cd ~/repos/node-spdy/node_modules 
➜  node_modules git:(master) ✗ mv vows vows.npm
➜  node_modules git:(master) ✗ ln -s ~/repos/vows
I am pretty sure that I recall npm arguments that allow me to symlink a local repository like that, but I know I recall the ln -s arguments.

Unfortunately, I am unable to isolate the error after that.


Day #118

No comments:

Post a Comment