Run unit tests in Chrome instead of PhantomJS

This commit adds karma-chrome-launcher and changes karma's settings
to use Chrome for all unit tests, removing PhantomJS. This change
is mainly to avoid downloading PhantomJS during gate tests, as the
phantomjs platform binaries would be downloaded from bitbucket and
their download servers have been returning rate limiting jobs and
returning 429 errors, leading to failed test runs. Since Chrome is
automatically installled from local mirrors, this should avoid the
problem entirely.

Change-Id: I5aba5480b34c4b4a6646f96c382c010495b3ea1b
This commit is contained in:
Tim Buckley 2016-03-15 15:11:08 -06:00
parent 40c3ffa4da
commit 567d9d2a24
6 changed files with 6 additions and 9 deletions

View File

@ -51,14 +51,13 @@
"karma": "~0.12.0",
"karma-babel-preprocessor": "^4.0.1",
"karma-browserify": "^4.0.0",
"karma-chrome-launcher": "^0.2.2",
"karma-cli": "0.0.4",
"karma-coverage": "0.2.6",
"karma-jasmine": "^0.3.6",
"karma-phantomjs-launcher": "0.2.0",
"karma-spec-reporter": "0.0.20",
"moment": "^2.11.1",
"morgan": "^1.6.1",
"phantomjs-prebuilt": "^2.1.1",
"pretty-hrtime": "^1.0.0",
"protractor": "^2.2.0",
"protractor-http-mock": "^0.1.18",

View File

@ -33,7 +33,7 @@ module.exports = function(config) {
autoWatch: true,
browsers: ['PhantomJS'],
browsers: ['Chrome'],
singleRun: true,
@ -43,7 +43,7 @@ module.exports = function(config) {
'karma-coverage',
'karma-jasmine',
'karma-spec-reporter',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
],
browserify: {

View File

@ -1,7 +1,5 @@
'use strict';
var phantomjs = require('phantomjs');
var gulpConfig = require('../gulp/config');
exports.config = {

View File

@ -33,7 +33,7 @@ describe('GroupedRunsController', function() {
var expectedResponse = {
timedelta: [
{
datetime: '2014-11-19',
datetime: '2014-11-19T00:00:00.000Z',
job_data: [
{
fail: 1,

View File

@ -65,7 +65,7 @@ describe('HomeController', function() {
var timestamp;
beforeEach(function() {
var date = new Date('2015-10-01T20:00:00');
var date = new Date('2015-10-01T20:00:00.000Z');
timestamp = date.getTime();
var metrics = { passes: 3, failures: 4, failRate: 0.57 };
var stats = [{ date: date, metrics: metrics }];

View File

@ -32,7 +32,7 @@ describe('JobController', function() {
function mockHealthService() {
var expectedResponse = {
tests: {
'2014-11-19T01:00:00': {
'2014-11-19T01:00:00.000Z': {
'tempest.api.compute.admin.test_fixed_ips:FixedIPsTestJson.test_list_fixed_ip_details': {
fail: 1,
pass: 27,