From 1da03a1e734c4b4e5666377045766e1417d1f837 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Sun, 18 May 2014 15:48:40 -0700 Subject: [PATCH 1/6] add to TRAVIS_COMMIT_MSG, TWBS_DO_VALIDATOR, TWBS_DO_SAUCE vars to Travis --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 4aa74c6cde..59ef5fe779 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,9 @@ before_install: - rvm use 1.9.3 --fuzzy - export GEMDIR=$(rvm gemdir) - if [ "$TWBS_TEST" = validate-html ]; then echo "ruby=$(basename $GEMDIR) jekyll=$JEKYLL_VERSION" > pseudo_Gemfile.lock; fi + - "export TRAVIS_COMMIT_MSG=\"$(git log --format=%B --no-merges -n 1)\"" + - echo "$TRAVIS_COMMIT_MSG" | grep '\[skip validator\]'; export TWBS_DO_VALIDATOR=$?; true + - echo "$TRAVIS_COMMIT_MSG" | grep '\[skip sauce\]'; export TWBS_DO_SAUCE=$?; true install: - time npm install -g grunt-cli - ./test-infra/s3_cache.py download npm-modules From df9f576583a082ad53afe4d324581c1c92779b23 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Sun, 18 May 2014 15:50:07 -0700 Subject: [PATCH 2/6] Travis: skip RubyGems install+cache when TWBS_DO_VALIDATOR=0 --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 59ef5fe779..6a778cf747 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,10 +12,10 @@ before_install: install: - time npm install -g grunt-cli - ./test-infra/s3_cache.py download npm-modules - - if [ "$TWBS_TEST" = validate-html ]; then ./test-infra/s3_cache.py download rubygems; fi + - if [ "$TWBS_TEST" = validate-html ] && [ $TWBS_DO_VALIDATOR -ne 0 ]; then ./test-infra/s3_cache.py download rubygems; fi after_script: - if [ "$TWBS_TEST" = core ]; then ./test-infra/s3_cache.py upload npm-modules; fi - - if [ "$TWBS_TEST" = validate-html ]; then ./test-infra/s3_cache.py upload rubygems; fi + - if [ "$TWBS_TEST" = validate-html ] && [ $TWBS_DO_VALIDATOR -ne 0 ]; then ./test-infra/s3_cache.py upload rubygems; fi env: global: - JEKYLL_VERSION: 1.5.0 From db26c9f4b479f7f1ace9f4a3af225be48c807139 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Sun, 18 May 2014 15:52:42 -0700 Subject: [PATCH 3/6] Gruntfile: extract runSubset() func --- Gruntfile.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 1373e3e1b2..ecf46a9992 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -401,20 +401,24 @@ module.exports = function (grunt) { // Docs HTML validation task grunt.registerTask('validate-html', ['jekyll', 'validation']); + var runSubset = function (subset) { + return !process.env.TWBS_TEST || process.env.TWBS_TEST === subset; + }; + // Test task. var testSubtasks = []; // Skip core tests if running a different subset of the test suite - if (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'core') { + if (runSubset('core')) { 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 (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'validate-html') { + if (runSubset('validate-html')) { 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 - (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'sauce-js-unit')) { + runSubset('sauce-js-unit')) { testSubtasks.push('connect'); testSubtasks.push('saucelabs-qunit'); } From 6638fc164970caf866344e9ef6a6127e2e2a6081 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Sun, 18 May 2014 15:53:40 -0700 Subject: [PATCH 4/6] Gruntfile: skip steps when $TWBS_DO_*=0 --- Gruntfile.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index ecf46a9992..2c33b474ec 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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'); } From ca23e3913ba8ba91f77d25f9a9021a1238142999 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Sun, 18 May 2014 16:03:15 -0700 Subject: [PATCH 5/6] prove that [skip sauce] works add extra newline to .travis.yml that I'll remove momentarily --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 6a778cf747..112b4c6d2a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,3 +32,4 @@ matrix: fast_finish: true notifications: slack: heybb:iz4wwosL0N0EdaX1gvgkU0NH + From 4a9ab6011d5fc250b216b90e028f2a4f4378b9e3 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Sun, 18 May 2014 16:05:16 -0700 Subject: [PATCH 6/6] prove that [skip validator] works removes the extra newline added in the previous commit --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 112b4c6d2a..6a778cf747 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,4 +32,3 @@ matrix: fast_finish: true notifications: slack: heybb:iz4wwosL0N0EdaX1gvgkU0NH -