Skip to content

Commit

Permalink
merge: Update ports and sauce tasks. (#15)
Browse files Browse the repository at this point in the history
IE6, and iPhone VM's are inconsistent, so leaving those out.

Updating karma:sauce tasks with acceptable ports, otherwise the browsers
in sauce labs won't be able to proxy properly.

* ports-and-sauce:
  Cleanup travis.yml
  Removing need to have travis install grunt-cli globally.
  Removing commented grunt tasks. Correct spaces to tabs.
  Changing ports. Adding platforms.
  Updating node version and env variables.
  Relocating curl in .travis.yml
  Travis will be testing sauce tasks.
  Separating browser tests into groups of 3 because we currently Sauce Labs offers OpenSauce accounts 3 concurrent browsers.
  Removing trailing comma to see if it's preventing browsers from loading.
  Setup travis + sauce + karma
  • Loading branch information
timwienk committed Mar 6, 2014
2 parents 47e00e3 + 044335b commit 74763b5
Show file tree
Hide file tree
Showing 4 changed files with 230 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -8,3 +8,4 @@ node_modules
mootools-all.js
mootools-nocompat.js
mootools-specs.js
sauce*.log
14 changes: 13 additions & 1 deletion .travis.yml
@@ -1,3 +1,15 @@
language: node_js

node_js:
- 0.10
- 0.11

env:
global:
- secure: hxXNl/FkYm4lukIM+drQ4qXe6swmVyUvZRFhUCnMUZBTGsEHjySq/S1Z7KH69/3I+ULqERMeFo/Hsuw3fmZqtGwbFS+XyPm2ulCdhRy/ypCupSeTx/DbHV5Aej4QeGKb5J0N1jEEowMs5zTjpCoyNiSW/oFP/xS5tiuwUOvL+AQ=
- secure: DdWSqy6Qzbnl3bTUIk+2oTEOghakK/UxtGow3ZUbzLxX9Lu924ve/7d+BQbJl+QsTqt+PYMPdpg6n7Y6oqOop6sAIRECPx/7lMx57whd0XHRXpLPbs2abXkFdG6w1x0ybm+6G2CiWUQ1BnmI1MqlkMmikK+X4jWgyJ7s1qYk4Us=

before_script:
- curl https://gist.github.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash

script:
- grunt default:travis
216 changes: 207 additions & 9 deletions Gruntfile.js
@@ -1,12 +1,34 @@
"use strict";

module.exports = function(grunt){
module.exports = function(grunt) {

grunt.loadNpmTasks('grunt-mootools-packager');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-contrib-clean');
require('load-grunt-tasks')(grunt);

grunt.initConfig({
'connect': {
testserver: {
options: {
// We use end2end task (which does not start the webserver)
// and start the webserver as a separate process
// to avoid https://github.com/joyent/libuv/issues/826
port: 8000,
hostname: '0.0.0.0',
middleware: function(connect, options) {
return [
function(req, resp, next) {
// cache get requests to speed up tests on travis
if (req.method === 'GET') {
resp.setHeader('Cache-control', 'public, max-age=3600');
}

next();
},
connect.static(options.base)
];
}
}
}
},

'packager': {

Expand Down Expand Up @@ -51,16 +73,181 @@ module.exports = function(grunt){
'karma': {

options: {
browsers: ['PhantomJS'],
captureTimeout: 60000 * 2,
singleRun: true,
frameworks: ['jasmine', 'sinon'],
files: ['http://rawgithub.com/bitovi/legacy-syn/master/dist/syn.js', 'mootools-*.js']
files: [
'http://rawgithub.com/bitovi/legacy-syn/master/dist/syn.js',
'mootools-*.js'
],
sauceLabs: {
username: process.env.SAUCE_USERNAME,
accessKey: process.env.SAUCE_ACCESS_KEY,
testName: 'MooTools-Core'
},
customLaunchers: {
chrome_linux: {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'linux'
},
firefox_linux: {
base: 'SauceLabs',
browserName: 'firefox',
platform: 'linux'
},
opera_win2000: {
base: 'SauceLabs',
browserName: 'opera',
platform: 'Windows 2008',
version: '12'
},
safari7: {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.9',
version: '7'
},
safari6: {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.8',
version: '6'
},
safari5_osx10_6: {
base: 'SauceLabs',
browserName: 'safari',
version: '5',
platform: 'OS X 10.6'
},
safari5_win7: {
base: 'SauceLabs',
browserName: 'safari',
version: '5',
platform: 'Windows 7'
},
ie11: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11'
},
ie10: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 8',
version: '10'
},
ie9: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 7',
version: '9'
},
ie8: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 7',
version: '8'
},
ie7: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows XP',
version: '7'
},
ie6: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows XP',
version: '6'
},
iphone_7: {
base: 'SauceLabs',
browserName: 'iphone',
platform: 'OS X 10.9',
version: '7',
deviceOrientation: 'portrait'
},
iphone_6_1: {
base: 'SauceLabs',
browserName: 'iphone',
platform: 'OS X 10.8',
version: '6.1',
deviceOrientation: 'portrait'
},
iphone_6: {
base: 'SauceLabs',
browserName: 'iphone',
platform: 'OS X 10.8',
version: '6',
deviceOrientation: 'portrait'
}
},
},

continuous: {
singleRun: true
browsers: ['PhantomJS']
},

sauce1: {
port: 9876,
browsers: [
'chrome_linux',
'firefox_linux',
'opera_win2000'
]
},

sauce2: {
port: 9877,
browsers: [
'safari7',
'safari6',
'safari5_osx10_6'
],
},

// safari5_win7, ie11 and ie10 are not loading the test page
sauce3: {
port: 9999,
browsers: [
'safari5_win7',
'ie11',
'ie10'
]
},

// ie9, ie8, and ie7 are not loading the test page
sauce4: {
port: 3000,
browsers: [
'ie9',
'ie8',
'ie7'
]
},

// ie6 is not loading the test page
// sauce5: {
// port: 9876,
// browsers: [
// 'ie6',
// 'iphone_7',
// 'iphone_6_1',
// ]
// },

// sauce6: {
// port: 9805,
// browsers: [
// 'iphone_6'
// ]
// },

dev: {
singleRun: false,
browsers: ['PhantomJS'],
reporters: 'dots'
}

Expand All @@ -75,5 +262,16 @@ module.exports = function(grunt){
});

grunt.registerTask('default', ['clean', 'packager:all', 'packager:specs', 'karma:continuous']);
grunt.registerTask('nocompat', ['clean', 'packager:nocompat', 'packager:specs-nocompat', 'karma:continuous'])
};
grunt.registerTask('nocompat', ['clean', 'packager:nocompat', 'packager:specs-nocompat', 'karma:continuous']);
grunt.registerTask('default:travis', [
'clean',
'packager:all',
'packager:specs',
'karma:sauce1',
'karma:sauce2',
'karma:sauce3',
'karma:sauce4'
// 'karma:sauce5',
// 'karma:sauce6'
])
};
13 changes: 9 additions & 4 deletions package.json
Expand Up @@ -4,7 +4,7 @@
"description": "MooTools is a compact, modular, Object-Oriented JavaScript framework designed for the intermediate to advanced JavaScript developer.",
"main": "index.js",
"scripts": {
"test": "grunt test -v"
"test": "./node_modules/.bin/grunt --verbose"
},
"repository": {
"type": "git",
Expand All @@ -30,9 +30,14 @@
"devDependencies": {
"grunt": "~0.4.2",
"grunt-mootools-packager": "^0.1.2",
"grunt-karma": "^0.6.2",
"karma-jasmine": "^0.1.5",
"grunt-contrib-clean": "~0.5.0",
"karma-sinon": "~1.0.2"
"grunt-contrib-connect": "~0.7.0",
"load-grunt-tasks": "~0.4.0",
"grunt-cli": "~0.1.13",
"karma": "~0.11.14",
"grunt-karma": "~0.7.2",
"karma-jasmine": "~0.1.5",
"karma-sinon": "~1.0.2",
"karma-sauce-launcher": "~0.2.0"
}
}

0 comments on commit 74763b5

Please sign in to comment.