26

I am able to run tests via Karma in TeamCity since you can run anything that's accessible via command line. But, TeamCity only reports overall pass/fail -- does not report details of any failed tests. If it fails, I just get "Process exited with code 1".

The karma homepage says there is a teamcity integration, but the teamcity link says "Not available yet".

There seems to be a GIT project with npm install package. But, the npm install failed with messages that don't mean much to me.

> npm http GET https://registry.npmjs.org/karma-teamcity-reporter npm
> http 304 https://registry.npmjs.org/karma-teamcity-reporter npm http
> GET https://registry.npmjs.org/karma npm http 304
> https://registry.npmjs.org/karma npm WARN `git config --get
> remote.origin.url` returned wrong result
> (git://github.com/vojtajina/node-di.git) undefined npm WARN `git
> config --get remote.origin.url` returned wrong result
> (git://github.com/vojtajina/node-di.git) undefined npm http GET
> https://registry.npmjs.org/chokidar npm http GET
> https://registry.npmjs.org/socket.io npm http GET
> https://registry.npmjs.org/http-proxy npm http GET
> https://registry.npmjs.org/glob npm http GET
> https://registry.npmjs.org/optimist npm http GET
> https://registry.npmjs.org/coffee-script npm http GET
> https://registry.npmjs.org/colors/0.6.0-1 npm http GET
> https://registry.npmjs.org/minimatch npm http GET
> https://registry.npmjs.org/pause/0.0.1 npm http GET
> https://registry.npmjs.org/mime npm ERR! git clone
> git://github.com/vojtajina/node-di.git undefined npm ERR! git clone
> git://github.com/vojtajina/node-di.git undefined npm http GET
> https://registry.npmjs.org/q npm http GET
> https://registry.npmjs.org/lodash npm http GET
> https://registry.npmjs.org/log4js npm http GET
> https://registry.npmjs.org/rimraf npm ERR! Error: spawn ENOENT npm
> ERR!     at errnoException (child_process.js:975:11) npm ERR!     at
> Process.ChildProcess._handle.onexit (child_process.js:766:34) npm ERR!
> If you need help, you may report this log at: npm ERR!    
> <http://github.com/isaacs/npm/issues> npm ERR! or email it to: npm
> ERR!     <[email protected]>
> 
> npm ERR! System Windows_NT 6.1.7601 npm ERR! command "C:\\Program
> Files\\nodejs\\\\node.exe" "C:\\Program
> Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
> "karma-teamcity-reporter" npm ERR! cwd C:\Users\steve npm ERR! node -v
> v0.10.5 npm ERR! npm -v 1.2.18 npm ERR! syscall spawn npm ERR! code
> ENOENT npm ERR! errno ENOENT npm http 304
> https://registry.npmjs.org/chokidar npm http 304
> https://registry.npmjs.org/optimist npm http 304
> https://registry.npmjs.org/socket.io npm http 304
> https://registry.npmjs.org/glob npm http 304
> https://registry.npmjs.org/http-proxy npm http 304
> https://registry.npmjs.org/coffee-script npm http 304
> https://registry.npmjs.org/colors/0.6.0-1 npm http 304
> https://registry.npmjs.org/minimatch npm http 304
> https://registry.npmjs.org/mime npm http 304
> https://registry.npmjs.org/pause/0.0.1 npm http 304
> https://registry.npmjs.org/q npm http 304
> https://registry.npmjs.org/lodash npm http 304
> https://registry.npmjs.org/log4js npm http 304
> https://registry.npmjs.org/rimraf npm ERR!  npm ERR! Additional
> logging details can be found in: npm ERR!    
> C:\Users\steve\npm-debug.log npm ERR! not ok code 0

I'm new to npm. So maybe I'm doing something wrong with npm. But, even if the npm install works, then what do I do? Should I expect the next teamcity run of karma to include the special teamcity log messages?

Anyone know how to fully integrate Karma into teamcity?

1 Answer 1

28

Use stable karma, which contains the teamcity reporter.

npm install -g karma

And then, use teamcity reporter, it will generate teamcity output on the stdout.

karma start --reporters teamcity --single-run
6
  • Super! I already had karma installed. All I had to do was update the command line in teamcity config. Thanks!!
    – steve
    May 8, 2013 at 18:19
  • @Vojta: When I run this command on team city with PhantomJS as the browser the run never completes. Do you know what is causing this issue?
    – RBZ
    Nov 13, 2013 at 22:31
  • 1
    @Vojta If I run karma start --reporters teamcity --single-run I get the following error: WARN [reporter]: Can not load "teamcity", it is not registered! Perhaps you are missing some plugin?
    – devlord
    Dec 17, 2013 at 21:23
  • 2
    Perhaps you are missing a plugin - github.com/karma-runner/karma-teamcity-reporter
    – Vojta
    Dec 24, 2013 at 7:53
  • 5
    also you must run once: npm install karma-teamcity-reporter, see stackoverflow.com/questions/16343543/…
    – knb
    Mar 6, 2014 at 9:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.