From da2834fc956853d1c286c361117f883fea8cba8f Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Wed, 25 May 2016 16:28:32 -0500 Subject: [PATCH 01/13] Use PHPUnit directly instead of wrapped in Gulp --- .travis.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5d8d9a89c6c8e..cbd816ae03e3a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ language: php # Setup a global environemnt and overide as needed env: global: - - WP_TRAVISCI=travis:phpunit + - WP_TRAVISCI=phpunit # Next we define our matrix of additional build configurations to test against. # The versions listed above will automatically create our first configuration, @@ -23,7 +23,7 @@ env: matrix: include: - php: "5.6" - env: WP_VERSION=4.5 WP_TRAVISCI=travis:js + env: WP_VERSION=4.5 WP_TRAVISCI="gulp travis:js" - php: "5.2" env: WP_VERSION=master - php: "5.2" @@ -94,7 +94,9 @@ before_script: - npm install -g gulp-cli - npm install -script: gulp $WP_TRAVISCI +script: + - gulp + - $WP_TRAVISCI sudo: false From 0463856a82a22395486968d17e197b2cb4c48644 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Wed, 25 May 2016 16:36:06 -0500 Subject: [PATCH 02/13] Unit Tests: Report JSHint failures --- gulpfile.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index e8bb96f2b6e60..91bad482b991d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -293,7 +293,8 @@ gulp.task( 'js:hint', function() { '!modules/**/*.min.js' ] ) .pipe( jshint( '.jshintrc' ) ) - .pipe( jshint.reporter('jshint-stylish') ); + .pipe( jshint.reporter('jshint-stylish') ) + .pipe( jshint.reporter('fail') ); } ); /* From 8d5c7f2445e99216ef1449fa7a6e0054343a2bd3 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Wed, 25 May 2016 17:12:37 -0500 Subject: [PATCH 03/13] Unit Tests: Remove mention of Travis' phpunit test. No longer in use. --- gulpfile.js | 1 - 1 file changed, 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 91bad482b991d..b95c1d7290613 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -367,5 +367,4 @@ gulp.task( 'old-styles', ['frontendcss', 'admincss', 'admincss:rtl', 'old-sass gulp.task( 'languages', ['languages:get', 'languages:build', 'languages:cleanup'] ); // travis CI tasks. -gulp.task( 'travis:phpunit', ['php:unit'] ); gulp.task( 'travis:js', ['js:hint', 'js:qunit'] ); From 09a4d14e6441e30ada4efd0af435d4fd52f570ed Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Wed, 25 May 2016 17:20:37 -0500 Subject: [PATCH 04/13] Unit Tests: gulp only for JS tests --- .travis.yml | 1 - gulpfile.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index cbd816ae03e3a..6e13e593bb8dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -95,7 +95,6 @@ before_script: - npm install script: - - gulp - $WP_TRAVISCI sudo: false diff --git a/gulpfile.js b/gulpfile.js index b95c1d7290613..6702e11af2570 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -367,4 +367,4 @@ gulp.task( 'old-styles', ['frontendcss', 'admincss', 'admincss:rtl', 'old-sass gulp.task( 'languages', ['languages:get', 'languages:build', 'languages:cleanup'] ); // travis CI tasks. -gulp.task( 'travis:js', ['js:hint', 'js:qunit'] ); +gulp.task( 'travis:js', ['react:build', 'js:hint', 'js:qunit'] ); From e47d4459104236041445fd790f14cb148c44e79f Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Wed, 25 May 2016 17:33:18 -0500 Subject: [PATCH 05/13] Unit Tests: Do not npm on phpunit tests --- .travis.yml | 7 +------ tests/load-travis.sh | 10 ++++++++++ 2 files changed, 11 insertions(+), 6 deletions(-) create mode 100755 tests/load-travis.sh diff --git a/.travis.yml b/.travis.yml index 6e13e593bb8dd..8d9066016c034 100644 --- a/.travis.yml +++ b/.travis.yml @@ -87,12 +87,7 @@ before_script: - sed -i "s/yourusernamehere/root/" wp-tests-config.php - sed -i "s/yourpasswordhere//" wp-tests-config.php - cd "/tmp/wordpress/src/wp-content/plugins/$PLUGIN_SLUG" - - gem install sass - - gem install compass - - nvm install 5 - - npm install -g npm@'3.8.9' - - npm install -g gulp-cli - - npm install + - ./tests/load-travis.sh script: - $WP_TRAVISCI diff --git a/tests/load-travis.sh b/tests/load-travis.sh new file mode 100755 index 0000000000000..538da1f17c415 --- /dev/null +++ b/tests/load-travis.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [ "$WP_TRAVISCI" != "phpunit" ]; then + gem install sass + gem install compass + nvm install 5 + npm install -g npm@'3.8.9' + npm install -g gulp-cli + npm install +fi \ No newline at end of file From bcf2c11195e1115edc5f3045b864ea9a71f47881 Mon Sep 17 00:00:00 2001 From: dereksmart Date: Wed, 25 May 2016 19:21:26 -0400 Subject: [PATCH 06/13] Gulp: remove gulp-shell as it's been blacklisted If we need this, we can use gulp-exec --- gulpfile.js | 8 -------- package.json | 1 - 2 files changed, 9 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 6702e11af2570..8222d7b5642e3 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -16,7 +16,6 @@ var autoprefixer = require( 'gulp-autoprefixer' ), rename = require( 'gulp-rename' ), rtlcss = require( 'gulp-rtlcss' ), sass = require( 'gulp-sass' ), - shell = require( 'gulp-shell' ), sourcemaps = require( 'gulp-sourcemaps' ), stylish = require( 'jshint-stylish'), util = require( 'gulp-util' ), @@ -241,13 +240,6 @@ gulp.task( 'old-sass:rtl', function() { } ); } ); -/* - Shell commands - */ -gulp.task( 'shell', shell.task( [ - 'echo hello' -], { verbose: true } ) ); - /* "Check" task Search for strings and fail if found. diff --git a/package.json b/package.json index 0a3572af55b0d..edc5c948a14d2 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,6 @@ "gulp-rtlcss": "^1.0.0", "gulp-sass": "^2.0.4", "gulp-sftp": "^0.1.5", - "gulp-shell": "^0.5.2", "gulp-sourcemaps": "^1.6.0", "gulp-util": "^3.0.6", "jshint": "2.9.1", From 23bc5cd914aafa76029846c2d6b6e662bcd1f862 Mon Sep 17 00:00:00 2001 From: dereksmart Date: Wed, 25 May 2016 19:23:19 -0400 Subject: [PATCH 07/13] Travis: Add a new test that will run `tests/runner.js`. Tests React stuff. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8d9066016c034..75c9854843d66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,8 @@ matrix: include: - php: "5.6" env: WP_VERSION=4.5 WP_TRAVISCI="gulp travis:js" + - php: "5.6" + env: WP_VERSION=4.5 WP_TRAVISCI="npm run test-client" - php: "5.2" env: WP_VERSION=master - php: "5.2" From 316809fb8219e6c548f9916fd63a26775f7e3a4c Mon Sep 17 00:00:00 2001 From: dereksmart Date: Wed, 25 May 2016 19:36:46 -0400 Subject: [PATCH 08/13] PHPunit: Require php 5.3 via XML for when running tests on 5.2 server --- phpunit.xml.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index dbe616b04f32e..acd1a86ce0025 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -44,6 +44,7 @@ tests/php/sync + tests/php/sync/test_interface.jetpack-sync-replicastore.php From 5326c89a03792a428e9e7e7e7a136aa76ea4785d Mon Sep 17 00:00:00 2001 From: dereksmart Date: Wed, 25 May 2016 20:03:54 -0400 Subject: [PATCH 09/13] try this --- phpunit.xml.dist | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index acd1a86ce0025..ca50575676259 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -44,6 +44,9 @@ tests/php/sync + tests/php/sync/test_interface.jetpack-sync-replicastore.php + + tests/php/sync/test_interface.jetpack-sync-replicastore.php From c0aa7c2d28a90652b8f0ea26e13a355d0d2317b0 Mon Sep 17 00:00:00 2001 From: dereksmart Date: Wed, 25 May 2016 20:06:45 -0400 Subject: [PATCH 10/13] try this way --- phpunit.xml.dist | 2 -- 1 file changed, 2 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ca50575676259..7f5375dfcc161 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -45,8 +45,6 @@ tests/php/sync tests/php/sync/test_interface.jetpack-sync-replicastore.php - - tests/php/sync/test_interface.jetpack-sync-replicastore.php From 8ca1b2f0eb83b7afe29922c6d199ccb85f005ff6 Mon Sep 17 00:00:00 2001 From: dereksmart Date: Wed, 25 May 2016 20:17:33 -0400 Subject: [PATCH 11/13] testdox --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 75c9854843d66..dc92cf60febda 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ language: php # Setup a global environemnt and overide as needed env: global: - - WP_TRAVISCI=phpunit + - WP_TRAVISCI="phpunit --testdox" # Next we define our matrix of additional build configurations to test against. # The versions listed above will automatically create our first configuration, From 0fb5e1bed6b87c0e9ea3bb6f5777d6cc10d437bb Mon Sep 17 00:00:00 2001 From: dereksmart Date: Wed, 25 May 2016 20:20:52 -0400 Subject: [PATCH 12/13] testdox2 --- tests/load-travis.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/load-travis.sh b/tests/load-travis.sh index 538da1f17c415..05e87b71c1d7c 100755 --- a/tests/load-travis.sh +++ b/tests/load-travis.sh @@ -1,10 +1,10 @@ #!/bin/bash -if [ "$WP_TRAVISCI" != "phpunit" ]; then +if [ "$WP_TRAVISCI" != "phpunit --testdox" ]; then gem install sass gem install compass nvm install 5 npm install -g npm@'3.8.9' npm install -g gulp-cli npm install -fi \ No newline at end of file +fi From 5bd363aa4fc59e49167efa5fed05b2493da272f7 Mon Sep 17 00:00:00 2001 From: dereksmart Date: Wed, 25 May 2016 20:27:09 -0400 Subject: [PATCH 13/13] separate suite --- phpunit.xml.dist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7f5375dfcc161..ca50575676259 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -45,6 +45,8 @@ tests/php/sync tests/php/sync/test_interface.jetpack-sync-replicastore.php + + tests/php/sync/test_interface.jetpack-sync-replicastore.php