]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Gruntfile: skip steps when $TWBS_DO_*=0
authorChris Rebert <code@rebertia.com>
Sun, 18 May 2014 22:53:40 +0000 (15:53 -0700)
committerChris Rebert <code@rebertia.com>
Mon, 19 May 2014 00:20:54 +0000 (17:20 -0700)
Gruntfile.js

index ecf46a9992e5594b0bfdd464c87b9c0b71ebc8a4..2c33b474ec5b8345db75433c1e0ce28a79161dc8 100644 (file)
@@ -404,6 +404,9 @@ module.exports = function (grunt) {
   var runSubset = function (subset) {
     return !process.env.TWBS_TEST || process.env.TWBS_TEST === subset;
   };
+  var isUndefOrNonZero = function (val) {
+    return val === undefined || val !== '0';
+  };
 
   // Test task.
   var testSubtasks = [];
@@ -412,13 +415,17 @@ module.exports = function (grunt) {
     testSubtasks = testSubtasks.concat(['dist-css', 'csslint', 'jshint', 'jscs', 'qunit', 'build-customizer-html']);
   }
   // Skip HTML validation if running a different subset of the test suite
-  if (runSubset('validate-html')) {
+  if (runSubset('validate-html') &&
+      // Skip HTML5 validator on Travis when [skip validator] is in the commit message
+      isUndefOrNonZero(process.env.TWBS_DO_VALIDATOR)) {
     testSubtasks.push('validate-html');
   }
   // Only run Sauce Labs tests if there's a Sauce access key
   if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined' &&
       // Skip Sauce if running a different subset of the test suite
-      runSubset('sauce-js-unit')) {
+      runSubset('sauce-js-unit') &&
+      // Skip Sauce on Travis when [skip sauce] is in the commit message
+      isUndefOrNonZero(process.env.TWBS_DO_SAUCE)) {
     testSubtasks.push('connect');
     testSubtasks.push('saucelabs-qunit');
   }