From a8618c4f957fe1fa0d8d2d57652b9372fdda767a Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Fri, 10 Jan 2014 23:46:57 -0700 Subject: [PATCH] Tests: Added setting of types and suites via env variables Fixes gh-6917 --- .travis.yml | 20 ++++++++++++++++---- Gruntfile.js | 17 ++++++++++++----- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index a48618fa431..97e9f00d1f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,22 @@ branches: only: - master env: - - JQUERIES=1.8.3 - - JQUERIES=1.10.2 - - JQUERIES=2.0.3 - - JQUERIES=git + - TYPES=unit + JQUERIES=1.8.3 + - TYPES=unit + JQUERIES=1.10.2 + - TYPES=unit + JQUERIES=2.0.3 + - TYPES=unit + JQUERIES=git + - TYPES=integration + JQUERIES=1.8.3 + - TYPES=integration + JQUERIES=1.10.2 + - TYPES=integration + JQUERIES=2.0.3 + - TYPES=integration + JQUERIES=git notifications: irc: channels: diff --git a/Gruntfile.js b/Gruntfile.js index ae6b2171558..d1f0f69fa4a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -656,13 +656,20 @@ module.exports = function( grunt ) { http: { options: { urls: (function() { - // Find the test files - var suites = _.without( ( grunt.option( "suites" ) || "" ).split( "," ), "" ), - types = _.without( ( grunt.option( "types" ) || "" ).split( "," ), "" ).sort().reverse(), // So that unit runs before integration - patterns, paths, + var patterns, paths, + suites = ( grunt.option( "suites" ) || process.env.SUITES || "" ).split( "," ), + types = ( grunt.option( "types" ) || process.env.TYPES || "" ).split( "," ), prefixes = ["tests/unit/", "tests/integration/"], versionedPaths = [], - jQueries = _.without( ( grunt.option( "jqueries" ) || process.env.JQUERIES || "" ).split( "," ), "" ); + jQueries = ( grunt.option( "jqueries" ) || process.env.JQUERIES || "" ).split( "," ); + + // Trim empties + suites = _.without( suites, "" ); + types = _.without( types, "" ); + jQueries = _.without( jQueries, "" ); + + // So that unit suites runs before integration suites + types = types.sort().reverse(); if( types.length ){ prefixes = [];