xolvio / rtd

DEPRECATED: The Test Runner for Meteor
164 stars 37 forks source link

Unable to run grunt with test example #24

Closed eprabhakar closed 11 years ago

eprabhakar commented 11 years ago

I was unable to run the 'grunt' command after following the steps posted here https://github.com/xolvio/real-time-development-with-meteor

I get the following error on the Ubuntu 12.04 system with node : v0.10.11 meteor: 0.6.4

Launching Selenium-server on port 4444 Launching Karma listener on port 9876 Launching Karma runner on port 9100 Launching Meteor on port 3000 Launching Mirror on port 8000 Waiting...ERROR [config]: Invalid config file! [ReferenceError: JASMINE is not defined] ReferenceError: JASMINE is not defined at Object. (/home/eprabhakar/sertalnew/Tests/RTD/sampl/real-time-development-with-meteor/test/rtd/karma.conf.js:6:5) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (/usr/lib/node_modules/karma/node_modules/coffee-script/lib/coffee-script/coffee-script.js:211:36) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.parseConfig (/usr/lib/node_modules/karma/lib/config.js:213:22) at Object.exports.start (/usr/lib/node_modules/karma/lib/server.js:235:20) at Object. (/usr/lib/node_modules/karma/bin/karma:20:39) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:901:3

Error: Command failed: Fatal error: Command failed:

Any help would be much appreciated as I want to really try this for my meteor project and I am unable to run the sample test

xolvio commented 11 years ago

Hello

Looks like Jasmine is missing from your system.

Did you run this:

sudo npm i -g karma phantomjs selenium-webdriver grunt-cli jasmine-node istanbul

That should install all the dependencies.

eprabhakar commented 11 years ago

Hi xolvio, Thank you for the quick response.

I found that I used the latest version of karma v0.9.3 which changed the karma.conf.js structure for JASMINE in karma v0.8.6 from

files = [ JASMINE, JASMINE_ADAPTER, '*.js', ];

to something like

frameworks = ["jasmine"]; in karma v0.9.3

I now downgraded the karma to 0.8.6 and it resolved the first issue.

Now I got into the following problem

Launching Selenium-server on port 4444 Launching Karma listener on port 9876 Launching Karma runner on port 9100 Launching Meteor on port 3000 Launching Mirror on port 8000 Waiting...>> Error: Command failed: Fatal error: Command failed:

After some more googling, I found that this is related to socket.io bug with Karma and occurs for node version 0.10.8 or above.

As I was running node v0.10.11, I downgraded it to v0.10.5 using the nvm, but still the same issue occurs to me.

Can you please throw some light here.

Regards Prabhakar

xolvio commented 11 years ago

Ah that makes sense. Thanks for letting me know, I'll update Karma in RTD

The error there could be due to compilation errors in your unit tests, or possibly PhantomJS. Try this:

https://github.com/xolvio/real-time-development-with-meteor/issues/11

xolvio commented 11 years ago

Hi. Try to update RTD. I did a fix for the Command failed issue

eprabhakar commented 11 years ago

Hi, Thank you for fixing the first error. I took the updated version and rerun it.

This time unit tests pass through, but the acceptance fail to execute.

Launching Selenium-server on port 4444 Launching Karma listener on port 9876 Launching Karma runner on port 9100 Launching Meteor on port 3000 Launching Mirror on port 8000 Waiting...

Failures:

1) Leaderboard functionality increases a players score by 5 when the increment button is clicked Message: timeout: timed out after 10000 msec waiting for App didn't reset Stacktrace: undefined

Finished in 10.546 seconds 1 test, 1 assertion, 1 failure, 0 skipped

Error: Command failed: Fatal error: Command failed:

Completed in 21.809s at Thu Jul 04 2013 10:31:19 GMT+0530 (IST) - Waiting...


Please let me know if you need additional information for this.

Thank you Prabhakar

xolvio commented 11 years ago

Are you able to access localhost:8000 and see the app running there?

xolvio commented 11 years ago

Try getting the latest again, today I fixed a chromedriver issue on linux.

eprabhakar commented 11 years ago

Thank you for looking into this again. The issue still occurs to me. For your information, I have attached the debug output here. I also observed that localhost:8000 is running after the test and localhost:8000/coverage also displays fine. I noticed that there is a 'linux_64' value for 'chromeDriverOs' for linux systems in the 'rtd.conf.js' file. Should I be setting this value along with the chromDriverVersion and chromeDirverSha ? Please let me know

sudo grunt --debug Running "bgShell:killAll" (bgShell) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee

Running "downloadAndOrStartSelenium" task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/Gruntfile.js

Downloading http://chromedriver.googlecode.com/files/chromedriver2_mac32_0.8.zip ............................................

Running "unzip:chromeDriver" (unzip) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-zip/tasks/zip.js File "/home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/../../test/rtd/lib/bin/" created.

Running "chmod" task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/Gruntfile.js

Running "bgShell:synchronizeMirrorApp" (bgShell) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee

Running "bgShell:instrumentCode" (bgShell) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee . Processed [3] files in 0 secs

Running "bgShell:startMirrorApp" (bgShell) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee

Running "bgShell:startKarma" (bgShell) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee

Running "bgShell:startApp" (bgShell) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee

Running "outputPorts" task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/Gruntfile.js Launching Selenium-server on port 4444 Launching Karma listener on port 9876 Launching Karma runner on port 9100 Launching Meteor on port 3000 Launching Mirror on port 8000

Running "watch" task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-contrib-watch/tasks/watch.js Waiting...[[[[[ ~/sertalnew/Tests/RTD/sampl/leaderboard/build/mirror_app ]]]]]

[[[[[ ~/sertalnew/Tests/RTD/sampl/leaderboard/app ]]]]]

=> Meteor server running on: http://localhost:3000/ => Meteor 0.6.4 is available. Update this project with 'meteor update'. => Meteor 0.6.4 is available. Update this project with 'meteor update'. Initializing mongo database... this may take a moment. => Meteor server running on: http://localhost:8000/ OK

File "../unit/server/leaderboard.js" changed. Running "bgShell:karmaRun" (bgShell) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee

  • - - Running unit tests - - - ........... PhantomJS 1.9 (Linux): Executed 11 of 11 SUCCESS (0.05 secs / 0.004 secs) ........... PhantomJS 1.9 (Linux): Executed 11 of 11 SUCCESS (0.05 secs / 0.004 secs)

Running "bgShell:synchronizeMirrorApp" (bgShell) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee

Running "bgShell:instrumentCode" (bgShell) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee => Meteor server restarted. Processed [3] files in 0 secs

Running "bgShell:runTests" (bgShell) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee

Failures:

1) Leaderboard functionality increases a players score by 5 when the increment button is clicked Message: timeout: timed out after 10000 msec waiting for App didn't reset Stacktrace: undefined

Finished in 10.602 seconds 1 test, 1 assertion, 1 failure, 0 skipped

Error: Command failed: Fatal error: Command failed:

Completed in 21.821s at Fri Jul 05 2013 06:52:06 GMT+0530 (IST) - Waiting...

xolvio commented 11 years ago

Yes definitely, you should disable all the OSX lines and enable the LINUX ones.

In fact, could you do me a favor and let me know what this outputs on linux?

console.log(process.platform)

Then I'll try to automate the OS detection

On Thu, Jul 4, 2013 at 6:32 PM, eprabhakar notifications@github.com wrote:

Thank you for looking into this again. The issue still occurs to me. For your information, I have attached the debug output here. I also observed that localhost:8000 is running after the test and localhost:8000/coverage also displays fine. I noticed that there is a 'linux_64' value for 'chromeDriverOs' for linux systems in the 'rtd.conf.js' file. Should I be setting this value along with the chromDriverVersion and chromeDirverSha ? Please let me know

sudo grunt --debug Running "bgShell:killAll" (bgShell) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee

Running "downloadAndOrStartSelenium" task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/Gruntfile.js

Downloading http://chromedriver.googlecode.com/files/chromedriver2_mac32_0.8.zip ............................................

Running "unzip:chromeDriver" (unzip) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-zip/tasks/zip.js File "/home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/../../test/rtd/lib/bin/" created.

Running "chmod" task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/Gruntfile.js

Running "bgShell:synchronizeMirrorApp" (bgShell) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee

Running "bgShell:instrumentCode" (bgShell) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee . Processed [3] files in 0 secs

Running "bgShell:startMirrorApp" (bgShell) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee

Running "bgShell:startKarma" (bgShell) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee

Running "bgShell:startApp" (bgShell) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee

Running "outputPorts" task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/Gruntfile.js

Launching Selenium-server on port 4444 Launching Karma listener on port 9876 Launching Karma runner on port 9100 Launching Meteor on port 3000 Launching Mirror on port 8000

Running "watch" task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-contrib-watch/tasks/watch.js Waiting...[[[[[ ~/sertalnew/Tests/RTD/sampl/leaderboard/build/mirror_app ]]]]]

[[[[[ ~/sertalnew/Tests/RTD/sampl/leaderboard/app ]]]]]

=> Meteor server running on: http://localhost:3000/ => Meteor 0.6.4 is available. Update this project with 'meteor update'. => Meteor 0.6.4 is available. Update this project with 'meteor update'. Initializing mongo database... this may take a moment. => Meteor server running on: http://localhost:8000/ OK

File "../unit/server/leaderboard.js" changed. Running "bgShell:karmaRun" (bgShell) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee

  • - - Running unit tests - - - ........... PhantomJS 1.9 (Linux): Executed 11 of 11 SUCCESS (0.05 secs / 0.004 secs) ........... PhantomJS 1.9 (Linux): Executed 11 of 11 SUCCESS (0.05 secs / 0.004 secs)

Running "bgShell:synchronizeMirrorApp" (bgShell) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee

Running "bgShell:instrumentCode" (bgShell) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee => Meteor server restarted. Processed [3] files in 0 secs

Running "bgShell:runTests" (bgShell) task [D] Task source: /home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee

  • - - Running acceptance tests - - - => Meteor server restarted (x2)F

Failures:

1) Leaderboard functionality increases a players score by 5 when the increment button is clicked Message: timeout: timed out after 10000 msec waiting for App didn't reset Stacktrace: undefined

Finished in 10.602 seconds

1 test, 1 assertion, 1 failure, 0 skipped

Error: Command failed: Fatal error: Command failed:

Completed in 21.821s at Fri Jul 05 2013 06:52:06 GMT+0530 (IST) - Waiting...

— Reply to this email directly or view it on GitHubhttps://github.com/xolvio/rtd/issues/24#issuecomment-20498086 .

eprabhakar commented 11 years ago

For the console.log(process.platform) it returns 'linux' I am running the Ubuntu 12.04 linux 64 bit OS.

In the acceptance test, 'leaderboard.spec.js' file, I changed the reference of 'chrome' to 'Chrome' browser in the 'reuseOrCreateSession' function. Now the acceptance test pass thru, but the 'coverage fails'. Please see the details below.

Output on the terminal

Finished in 10.59 seconds 1 test, 4 assertions, 0 failures, 0 skipped

Failures:

1) Test coverage checker checks the coverage results against the thresholds Message: timeout: timed out after 5000 msec waiting for spec to complete

Finished in 5.525 seconds 1 test, 1 assertion, 1 failure, 0 skipped

Error: Command failed: Fatal error: Command failed:

Output on the browser for 'http:localhost:8000/coverage

TypeError: Cannot read property 'start' of undefined at tmp (/home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/lib/istanbul-middleware-port/.npm/node_modules/istanbul/lib/object-utils.js:58:44) at Array.forEach (native) at Object.addDerivedInfoForFile (/home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/lib/istanbul-middleware-port/.npm/node_modules/istanbul/lib/object-utils.js:57:37) at Object.Collector.fileCoverageFor (/home/eprabhakar/sertalnew/Tests/RTD/sampl/leaderboard/test/rtd/lib/istanbul-middleware-port/.npm/node_modules/istanbul/lib/collector.js:93:15) at app/packages/istanbul-middleware-port/core.js:143:86 at Array.forEach (native) at getTreeSummary (app/packages/istanbul-middleware-port/core.js:142:23) at Object.core.render (app/packages/istanbul-middleware-port/core.js:186:19) at app.get.origUrl (app/packages/istanbul-middleware-port/handlers.js:31:14) at Object. (app/packages/istanbul-middleware-port/express-shim.js:16:13)

Zev23 commented 11 years ago

I did the 'chrome' to 'Chrome' but my acceptance test doesn't seems to work (playback of test) although localhost:8000 has refresh at the point.

At the end I also have the same error at coverage test as @eprabhakar.

@xolvio can you list out the version of the packages you installed with? npm list -g karma phantomjs selenium-webdriver grunt-cli jasmine-node istanbul

These are mine: /usr/local/lib grunt-cli@0.1.9 istanbul@0.1.39 jasmine-node@1.10.1 karma@0.8.6 |--istanbul@0.1.22 phantomjs@1.9.0-6 selenium-webdriver@2.33.0

[[DEBUG LOG]] OK

File "../../app/client/leaderboard.js" changed. => Meteor server restartedRunning "bgShell:karmaRun" (bgShell) task [D] Task source: /home/usr/real-time-development-with-meteor/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell .coffee

  • - - Running unit tests - - - ...................... Chrome 28.0 (Linux): Executed 11 of 11 SUCCESS (0.481 secs / 0.098 secs)

Chrome 28.0 (Linux): Executed 11 of 11 SUCCESS (0.481 secs / 0.098 secs)

Running "bgShell:synchronizeMirrorApp" (bgShell) task [D] Task source: /home/usr/real-time-development-with-meteor/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell .coffee

Running "bgShell:instrumentCode" (bgShell) task [D] Task source: /home/usr/real-time-development-with-meteor/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell .coffee . Processed [3] files in 0 secs

Running "bgShell:runTests" (bgShell) task [D] Task source: /home/usr/real-time-development-with-meteor/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell .coffee

Running "bgShell:killReports" (bgShell) task [D] Task source: /home/usr/real-time-development-with-meteor/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell .coffee

Running "bgShell:runCoverageCheck" (bgShell) task [D] Task source: /home/usr/real-time-development-with-meteor/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell .coffee

Failures:

1) Test coverage checker checks the coverage results against the thresholds Message: timeout: timed out after 5000 msec waiting for spec to complete

Finished in 6.466 seconds 1 test, 1 assertion, 1 failure, 0 skipped

Error: Command failed: Fatal error: Command failed:

Completed in 44.866s at Fri Jul 05 2013 10:52:54 GMT+0800 (MYT) - Waiting...

eprabhakar commented 11 years ago

Well, here is the list of versions I have

/usr/lib ├── grunt-cli@0.1.9 ├── istanbul@0.1.37 ├── jasmine-node@1.10.1 ├─┬ karma@0.8.6 │ └── istanbul@0.1.22 ├── phantomjs@1.9.1-0 └── selenium-webdriver@2.33.0

In addition, Node is running at v0.10.11 Meteor is at release 0.6.4

@Zev23 , are you running the grunt with 'sudo grunt --debug' option? Initially when I had to run 'npm install' in the ./test/rtd folder, it raised an EACCESS error, so I had to use 'sudo npm install'. Now, I use only 'sudo grunt' to run the grunt.

Zev23 commented 11 years ago

I don't have to 'sudo' to do grunt and npm install in test/rtd folder. Just tried 'sudo grunt -d', same outcome. It seems the coverage issue discussion is in issue #27. I'm reading it now.

This is my notes when installing node (w/ nave) & npm in ubuntu. [[NOTES]]

  1. Run the steps in Installation from Package (Ubuntu) and install nave globally sudo apt-get install npm sudo npm install -g nave nave install stable (*this one not yet using the stable version, use "usemain" later)
  2. Remove the nodejs and npm by apt-get: sudo apt-get remove nodejs npm
  3. Using stable node globally sudo nave usemain stable
  4. Install latest npm from npmjs.org curl https://npmjs.org/install.sh | sudo sh (after that, sudo npm i -g npm@1.2.32 to downgrade the version)

_Note: If npm/node command is not found, run the following: hash -r (_No harm if any command is found)

  1. check with 'nave list'

*npm 1.3.x has problem with packages with version not conform to X.Y.Z So package like underscore.string 2.2.0-rc will have problem with npm 1.3.x Solution: downgrade to 1.2.32

xolvio commented 11 years ago

Hey guys, marking this as a duplicate of this issue.

https://github.com/xolvio/rtd/issues/27

I wish I could repeat it locally