Skip to content

Commit

Permalink
Merge pull request #304 from w33ble/sauce-tests
Browse files Browse the repository at this point in the history
Fixing Sauce running on Travis
  • Loading branch information
spenceralger committed Sep 17, 2014
2 parents 5dbdb76 + 05b9362 commit f3a11a9
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ notifications:
hipchat:
rooms:
secure: a2FERvICecrUAR62vP4vrUCTG3haRzf6kSzDDzGu6SICEXWLRrK0xeNQDpdwDAfzFmaIJ6txpkmInvEFeNPYNngTgEDyfhqdIa/lW0Ermdg+1hL0dK6QJiVmT1V6LDB2mgtaTTmfontxJqq7P2tmr0zz8ny4Eqq3lUnwPxYFNNo=
template:
- ! '%{repository}/%{branch} #%{build_number} by %{author}: %{message} (<a href="%{build_url}">open</a>)'
format: html
on_success: change
template:
- ! '%{repository_slug}/%{branch} by %{author}: %{commit_message} (<a href="%{build_url}">open</a>)'
env:
global:
secure: AX9xidE0quyS07ZfOcecxEGjlNDT9YlM+fvtQHqOaODBII2jg5rgz0SyyxmTPSG68aqUNk8ML9slbRE4h0iPqNkB6fbDE2Dc6oTrRE7XFGDBjw66OHV2ZbsobdORf4UtWO06JBgLUEU2pzRYphe/B14dyA+ZO6p+bAgBmcdLd8k=
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ module.exports = function (grunt) {
});

// load task definitions
grunt.loadTasks('tasks');
grunt.task.loadTasks('tasks');
};
11 changes: 5 additions & 6 deletions tasks/config/saucelabs-mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ if (process.env.TRAVIS_BUILD_ID) {
module.exports = {
unit: {
options: {
urls: [
'http://localhost:8000/test/unit/?saucelabs=true'
],
username: 'kibana',
key: process.env.SAUCE_ACCESS_KEY,
urls: ['http://localhost:8000/test/unit/?saucelabs=true'],
testname: 'Kibana Browser Tests',
build: buildId,
concurrency: 10,
username: 'kibana',
key: process.env.SAUCE_ACCESS_KEY,
'max-duration': 360,
'max-duration': 60,
maxRetries: 1,
browsers: [
{
browserName: 'chrome',
Expand Down
1 change: 1 addition & 0 deletions tasks/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module.exports = function (grunt) {
var done = this.async();
var DevServer = require('../test/utils/dev_server');
var server = new DevServer();

server.listen(8000).then(function () {
console.log('visit http://localhost:8000');
if (keepalive !== 'keepalive') done();
Expand Down
29 changes: 20 additions & 9 deletions tasks/test.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
var _ = require('lodash');
module.exports = function (grunt) {

var testTask = process.env.TRAVIS ? 'saucelabs-mocha:unit' : 'mocha:unit';

grunt.registerTask('test', [
'jshint',
'ruby_server',
'maybe_start_server',
'jade',
'less',
testTask
]);
grunt.registerTask('test', function () {
var testTask = 'mocha:unit';
if (process.env.TRAVIS && !process.env.SAUCE_ACCESS_KEY) {
grunt.log.writeln(grunt.log.wordlist([
'>> SAUCE_ACCESS_KEY not set in env, running with Phantom'
], {color: 'yellow'}));
} else {
testTask = 'saucelabs-mocha:unit';
}

var tasks = [
'jshint',
'ruby_server',
'maybe_start_server',
'jade',
'less',
testTask
];
grunt.task.run(tasks);
});

grunt.registerTask('coverage', [
'blanket',
Expand Down

0 comments on commit f3a11a9

Please sign in to comment.