2013-05-02 10 views
23

Tôi có thể chạy thử nghiệm thông qua Karma trong TeamCity vì bạn có thể chạy bất cứ điều gì có thể truy cập thông qua dòng lệnh. Tuy nhiên, TeamCity chỉ báo cáo tổng thể vượt qua/thất bại - không báo cáo chi tiết của bất kỳ thử nghiệm không thành công. Nếu nó không thành công, tôi chỉ nhận được "Process exited with code 1".Làm thế nào để tích hợp Karma với TeamCity

Trang chủ karma cho biết có tích hợp nhóm, nhưng teamcity link cho biết "Chưa có sẵn".

Dường như có dự án GIT với npm install package. Tuy nhiên, việc cài đặt npm thất bại với các thông điệp không có ý nghĩa nhiều với tôi.

> 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 

Tôi mới đến npm. Vì vậy, có lẽ tôi đang làm điều gì đó sai với npm. Nhưng, ngay cả khi cài đặt npm hoạt động, thì tôi phải làm gì? Tôi có nên mong đợi sự vận hành của nghiệp đoàn tiếp theo để bao gồm những thông điệp đặc biệt về tính hợp tác của nhóm không?

Bất cứ ai cũng biết cách tích hợp đầy đủ Karma vào sự đồng đội?

Trả lời

23

Sử dụng nghiệp ổn định, trong đó có phóng viên nhóm.

npm install -g karma 

Sau đó, sử dụng trình báo cáo nhóm, nó sẽ tạo ra sản lượng đồng đội trên stdout.

karma start --reporters teamcity --single-run 
+0

Siêu! Tôi đã cài đặt nghiệp. Tất cả những gì tôi phải làm là cập nhật dòng lệnh trong cấu hình teamcity. Cảm ơn!! – steve

+0

@Vojta: Khi tôi chạy lệnh này trên thành phố nhóm với PhantomJS khi trình duyệt chạy không bao giờ hoàn thành. Bạn có biết điều gì đang gây ra sự cố này không? – RBZ

+0

Có thể [vấn đề này] (https://github.com/karma-runner/karma-teamcity-reporter/issues/5) - bài viết cần phải đồng bộ cho TeamCity để báo cáo. – Mendhak