Karma + Xvfb + Firefox不再起作用了

时间:2015-06-24 10:36:18

标签: firefox jenkins karma-runner karma-jasmine xvfb

我的CI设置出了问题。 由于几天Firefox不再与Karma一起运行我们的Jasmine测试。 但Chrome确实如此 - 所以错误不应该依赖于测试本身。 在我的开发环境中,它也运行。 我没有更改CI服务器(Ubuntu)上的任何内容。

会发生什么: Firefox正在连接到Web服务器并建立会话。 但测试没有执行。

我已尝试过的内容: 我已经改变了超时。 我已经重启了机器(几次)。 我已经重新安装了firefox。

你有一个想法,是什么导致这种奇怪的行为或我如何调试它?

我们正在使用

  • karma@0.12.37
  • karma-jasmine@0.3.5
  • karma-firefox-launcher@0.1.6
  • Firefox v.38.0
  • Ubuntu
  • nodejs v.0.10.25
  • npm v 1.3.10
  • 的Xvfb

karma.conf.js

  module.exports = function(config) {
          config.set({
                  browserNoActivityTimeout: 100000,
                  basePath: 'src/main/webapp/',
                  singleRun: true,
                  // autoWatch: true,
                  logLevel: config.LOG_DEBUG,
                  files: [
                          'assets/libs/jquery/dist/jquery.min.js',
                          'assets/libs/angular/angular.min.js',
                          'assets/libs/angular-mocks/angular-mocks.js',
                          'assets/libs/**/*.min.js',
                          'app/app.js',
                          'app/**/*.js',
                          'app/directives/*/*.html',
                          'app/directives/*/*.js',
                          '../../test/frontend/**/*.js', {
                                  pattern: 'assets/libs/**/*.map',
                                  included: false
                          },
                          'app/views/*.html'
                  ],
                  preprocessors: {
                          'app/views/*.html': 'ng-html2js',
                          'app/directives/*/*.html': 'ng-html2js'
                  },
                  frameworks: ['jasmine'],
                  browsers: [
                          'Firefox'
                  ],
                  plugins: [
                          'karma-chrome-launcher',
                          'karma-firefox-launcher',
                          'karma-safari-launcher',
                          'karma-ie-launcher',
                          'karma-jasmine',
                          'karma-junit-reporter',
                          'karma-ng-html2js-preprocessor'
                  ],
                  reporters: ['progress', 'junit'],
                  junitReporter: {
                          outputFile: '../../../build/test-results/karma-test-results.xml'
                  },
                  ngHtml2JsPreprocessor: {
                          moduleName: 'myc-templates'
                  }
          });
  };

输出xvfb-run karma start'

INFO [karma]: Karma v0.12.37 server started at http://localhost:9876/
INFO [launcher]: Starting browser Firefox
DEBUG [temp-dir]: Creating temp dir at /tmp/karma-70931573
DEBUG [launcher]: firefox http://localhost:9876/?id=70931573 -profile /tmp/karma-70931573 -no-remote
DEBUG [web-server]: serving: /var/lib/jenkins/jobs/MYC/workspace/node_modules/karma/static/client.html
DEBUG [web-server]: serving: /var/lib/jenkins/jobs/MYC/workspace/node_modules/karma/static/karma.js
DEBUG [web-server]: serving: /var/lib/jenkins/jobs/MYC/workspace/node_modules/karma/static/favicon.ico
DEBUG [web-server]: upgrade /socket.io/1/websocket/5wtT2gW7_XuaTRZ3Gctt
DEBUG [karma]: A browser has connected on socket 5wtT2gW7_XuaTRZ3Gctt
INFO [Firefox 38.0.0 (Ubuntu 0.0.0)]: Connected on socket 5wtT2gW7_XuaTRZ3Gctt with id 70931573
DEBUG [launcher]: Firefox (id 70931573) captured in 3.542 secs
DEBUG [web-server]: serving: /var/lib/jenkins/jobs/MYC/workspace/node_modules/karma/static/context.html
DEBUG [Firefox 38.0.0 (Ubuntu 0.0.0)]: Disconnected during run, waiting 2000ms for reconnecting.
WARN [Firefox 38.0.0 (Ubuntu 0.0.0)]: Disconnected (1 times)

DEBUG [karma]: Run complete, exiting.
DEBUG [launcher]: Disconnecting all browsers
DEBUG [reporter.junit]: JUnit results written to "/var/lib/jenkins/jobs/MYC/workspace/build/test-results/karma-test-results.xml".
DEBUG [launcher]: Process Firefox exited with code 0
DEBUG [temp-dir]: Cleaning temp dir /tmp/karma-70931573
npm ERR! weird error 1
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! not ok code 0

非常感谢任何关于如何解决这个问题的想法或想法; - )

谢谢,塞巴斯蒂安

0 个答案:

没有答案