on travis, use grunt-saucelabs rather than phantomjs

This commit is contained in:
Spencer Alger 2014-09-12 16:36:13 -07:00
parent 9488d1d7e4
commit 080311e19b
6 changed files with 79 additions and 24 deletions

View file

@ -1,20 +1,23 @@
language: node_js
node_js:
- '0.10'
- '0.10'
install:
- npm install -g grunt-cli bower
- npm install
- bower install
- npm install -g grunt-cli bower
- npm install
- bower install
script:
- npm test
- npm test
notifications:
email:
- rashid.khan@elasticsearch.com
- rashid.khan@elasticsearch.com
hipchat:
rooms:
secure: a2FERvICecrUAR62vP4vrUCTG3haRzf6kSzDDzGu6SICEXWLRrK0xeNQDpdwDAfzFmaIJ6txpkmInvEFeNPYNngTgEDyfhqdIa/lW0Ermdg+1hL0dK6QJiVmT1V6LDB2mgtaTTmfontxJqq7P2tmr0zz8ny4Eqq3lUnwPxYFNNo=
template:
- '%{repository}/%{branch} #%{build_number} by %{author}: %{message} (<a href="%{build_url}">open</a>)'
- '%{repository}/%{branch} #%{build_number} by %{author}: %{message} (<a href="%{build_url}">open</a>)'
format: html
on_success: change
on_failure: always
on_failure: always
env:
global:
secure: AX9xidE0quyS07ZfOcecxEGjlNDT9YlM+fvtQHqOaODBII2jg5rgz0SyyxmTPSG68aqUNk8ML9slbRE4h0iPqNkB6fbDE2Dc6oTrRE7XFGDBjw66OHV2ZbsobdORf4UtWO06JBgLUEU2pzRYphe/B14dyA+ZO6p+bAgBmcdLd8k=

View file

@ -22,6 +22,7 @@
"grunt-mocha": "~0.4.10",
"grunt-replace": "^0.7.9",
"grunt-run": "^0.2.3",
"grunt-saucelabs": "~8.3.2",
"http-proxy": "~1.1.4",
"husky": "~0.6.0",
"istanbul": "~0.2.4",

View file

@ -0,0 +1,25 @@
module.exports = {
unit: {
options: {
urls: [
'http://localhost:8000/test/unit/'
],
testname: 'Kibana Browser Tests',
build: process.env.TRAVIS_BUILD_ID || 'test build',
concurrency: 10,
username: 'kibana',
key: process.env.SAUCE_ACCESS_KEY,
browsers: [
{
browserName: 'googlechrome',
platform: 'XP'
},
{
browserName: 'internet explorer',
version: '10',
platform: 'Windows 7'
}
]
}
}
};

View file

@ -1,11 +1,13 @@
var _ = require('lodash');
module.exports = function (grunt) {
/* jshint scripturl:true */
var testTask = process.env.TRAVIS ? 'saucelabs-mocha:unit' : 'mocha:unit';
grunt.registerTask('test', [
'ruby_server',
'maybe_start_server',
'jade',
'mocha:unit',
testTask,
'jshint'
]);

View file

@ -123,8 +123,42 @@
window.mochaRunner = mocha.run().on('end', function () {
window.mochaResults = this.stats;
window.mochaResults.details = getFailedTests(this);
xhr.restore();
});
function getFailedTests(runner) {
var fails = [];
var suiteStack = [];
(function recurse(suite) {
suiteStack.push(suite);
(suite.tests || [])
.filter(function (test) {
return test.state === 'failed';
})
.forEach(function (test) {
fails.push({
title: suiteStack.reduce(function (title, suite) {
if (suite.title) {
return (title ? title + ' ' : '') + suite.title;
} else {
return title;
}
}, ''),
err: test.err ? (test.err.stack || test.err.message) : 'unknown error'
});
});
(suite.suites || []).forEach(recurse);
suiteStack.pop();
}(runner.suite));
return fails;
}
});
});
}

View file

@ -178,22 +178,12 @@ define(function (require) {
});
describe('render Method', function () {
beforeEach(function (done) {
var $node = $(yAxis.el);
beforeEach(function () {
expect(d3.select(yAxis.el).selectAll('.y-axis-div')).to.have.length(1);
this.timeout(30000);
[$(yAxis.el), $(yAxis.el).find('.y-axis-div')].forEach(debug);
(function check() {
if ($node.css('display') !== '-webkit-box') {
console.log('waiting for css to load');
setTimeout(check, 1000);
} else {
expect(d3.select(yAxis.el).selectAll('.y-axis-div')).to.have.length(1);
[$(yAxis.el), $(yAxis.el).find('.y-axis-div')].forEach(debug);
yAxis.render();
done();
}
}());
yAxis.render();
});
it('should append an svg to div', function () {