Skip to content
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

'Invalid Software Version' error when running Mocha #9

Open
ElliotChong opened this issue Jul 6, 2013 · 6 comments
Open

'Invalid Software Version' error when running Mocha #9

ElliotChong opened this issue Jul 6, 2013 · 6 comments

Comments

@ElliotChong
Copy link

image

Seeing an 'Invalid Software Version' error when running node-theseus on Mocha. This error does not occur when running node-theseus on other applications.

Repro steps:
1.) Install and run Brackets Sprint 26
2.) Install Theseus using: https://s3.amazonaws.com/theseus-downloads/theseus-0.3.0.zip
3.) Install node v0.10.12
4.) npm install -g node-theseus
5.) npm install -g mocha
6.) Grab mocha executable path using which mocha
7.) node-theseus ~/.nvm/v0.10.12/bin/mocha theseus-verbose=2
8.) Switch to Brackets and view error. No results are displayed.

@ElliotChong
Copy link
Author

The output for node-theseus in verbose mode is:

[node-theseus] adding require() instrumentation hook
[node-theseus] listening for WebSocket connections on port 8888
[node-theseus] excluding node_module ~/.nvm/v0.10.12/lib/node_modules/mocha/bin/mocha
[node-theseus] debugger connected
[node-theseus] received debugger message: {"name":"version","arguments":[],"id":0}
[node-theseus] sending debugger message: { id: 0 }
[node-theseus] received debugger message: {"name":"trackExceptions","arguments":[],"id":1}
[node-theseus] sending debugger message: { id: 1 }
[node-theseus] received debugger message: {"name":"trackLogs","arguments":[{"ids":[],"logs":true}],"id":2}
[node-theseus] sending debugger message: { id: 2 }
[node-theseus] received debugger message: {"name":"trackEpochs","arguments":[],"id":3}
[node-theseus] sending debugger message: { id: 3 }
[node-theseus] received debugger message: {"name":"trackHits","arguments":[],"id":4}
[node-theseus] sending debugger message: { id: 4 }
[node-theseus] received debugger message: {"name":"trackExceptions","arguments":[],"id":5}
[node-theseus] sending debugger message: { id: 5 }
[node-theseus] received debugger message: {"name":"trackNodes","arguments":[],"id":6}
[node-theseus] sending debugger message: { id: 6 }
[node-theseus] received debugger message: {"name":"newExceptions","arguments":[null],"id":7}
[node-theseus] sending debugger message: { id: 7 }
[node-theseus] received debugger message: {"name":"epochDelta","arguments":[null],"id":8}
[node-theseus] sending debugger message: { id: 8 }



  0 passing (1 ms)

[node-theseus] received debugger message: {"name":"epochDelta","arguments":[null],"id":9}
[node-theseus] sending debugger message: { id: 9 }
[node-theseus] received debugger message: {"name":"epochDelta","arguments":[null],"id":10}
[node-theseus] sending debugger message: { id: 10 }
[node-theseus] received debugger message: {"name":"epochDelta","arguments":[null],"id":11}
[node-theseus] sending debugger message: { id: 11 }
[node-theseus] received debugger message: {"name":"epochDelta","arguments":[null],"id":12}
[node-theseus] sending debugger message: { id: 12 }
[node-theseus] received debugger message: {"name":"epochDelta","arguments":[null],"id":13}
[node-theseus] sending debugger message: { id: 13 }
[node-theseus] received debugger message: {"name":"epochDelta","arguments":[null],"id":14}
[node-theseus] sending debugger message: { id: 14 }
[node-theseus] received debugger message: {"name":"epochDelta","arguments":[null],"id":15}
...

The 0 passing (1 ms) is a console.log from Mocha.

@ElliotChong
Copy link
Author

Running node-theseus with the --theseus-include-modules seems to fix Brackets throwing up that error; however, a new issue has emerged since my mocha tests don't seem to be instrumented / reporting in Brackets...

In any case, going to leave this issue open since the versions of Theseus and node-theseus are up to date / compatible and the shown error is misleading.

@alltom
Copy link
Member

alltom commented Jul 10, 2013

Still going through my inbox after coming back from vacation. :) I'm checking this out now.

@alltom
Copy link
Member

alltom commented Jul 10, 2013

Thanks for reporting this!

Bug 1: If no files ending in .js are ever require'd, tracer is never initialized, calls to tracer.version() throw an exception, and Theseus reports that the version is wrong. I'll fix this soon-ish.

Bug 2: If new instances of node are spawned with child_process, they don't get instrumented. mocha does this; it's just a wrapper for _mocha, which it so happens you can invoke directly with node-theseus _mocha. Fixing this has ramifications all the way up and down the Theseus stack, so it won't be fixed for a while, but for now just use _mocha.

Bug 3: If a script calls process.exit(), the process exits and you can't debug it. _mocha does this when the tests finish. Fixing this is as simple as process.exit = function () { }. As a work-around, you can add that to the top of node-theseus today, though I'll add it myself soon-ish.

@ElliotChong
Copy link
Author

Thanks so much for the detailed reply and workarounds!

@ElliotChong
Copy link
Author

Sorry, will leave this open until the fixes are in place.

alltom added a commit that referenced this issue Jul 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants