无法从詹金斯那里运行grunt-karma

时间:2013-07-11 06:43:19

标签: angularjs jenkins gruntjs

我正在使用Grunt-karma来启动我的角度单元测试。当我在命令提示符下执行任务时它工作正常但是当我配置相同的jenkins时无法打开firefox窗口。可以有人告诉我什么是问题.Below是我的配置文件

- karma config

basePath = '../';

files = [
  MOCHA,
  MOCHA_ADAPTER,
  'test/lib/angular/chai.js',
  'Scripts/angular.js',
  'Scripts/angular-*.js',
  'test/lib/angular/angular-mocks.js',
  'Scripts/ControllerForTest.js',
  'Scripts/ControllerForTestModule.js',
  'Scripts/LogLoader.js',
  'Scripts/App.js',
  'test/unit/**/*.js'
];

autoWatch = false;
singleRun = true;

browsers = ['Firefox'];

junitReporter = {
  outputFile: 'test_out/unit.xml',
  suite: 'unit'
};

Grunt任务 -

karma: {
            unit: {
                configFile: 'config/karma.conf.js'
            }
        },

Jenkins Log -

E:\MedicineShopInvetory\MedicineShopInventory\MedicineShopInventory>grunt
[4mRunning "clean:src" (clean) task[24m
Cleaning "release"...[32mOK[39m

[4mRunning "uglify:dist" (uglify) task[24m
File "release/app.min.js" created.

[4mRunning "cssmin:minify" (cssmin) task[24m
File release/Doc.min.css created.

[4mRunning "karma:unit" (karma) task[24m
[32mINFO [karma]: [39mKarma server started at http://localhost:9876/
[32mINFO [launcher]: [39mStarting browser Firefox
[33mWARN [launcher]: [39mFirefox have not captured in 60000 ms, killing.
[32mINFO [launcher]: [39mTrying to start Firefox again.

1 个答案:

答案 0 :(得分:0)

你是如何运行詹金斯的?如果你在无头服务器上运行它,你可能从未开始像xvfb这样的无头显示器,如果你有,可能是你没有导出显示器。