Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/travis tests #2

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
16 changes: 7 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ language: php
# Setup a global environemnt and overide as needed
env:
global:
- WP_TRAVISCI=travis: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,
Expand All @@ -23,7 +23,9 @@ 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.6"
env: WP_VERSION=4.5 WP_TRAVISCI="npm run test-client"
- php: "5.2"
env: WP_VERSION=master
- php: "5.2"
Expand Down Expand Up @@ -87,14 +89,10 @@ 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: gulp $WP_TRAVISCI
script:
- $WP_TRAVISCI

sudo: false

Expand Down
14 changes: 3 additions & 11 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' ),
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -293,7 +285,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') );
} );

/*
Expand Down Expand Up @@ -366,5 +359,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'] );
gulp.task( 'travis:js', ['react:build', 'js:hint', 'js:qunit'] );
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
</testsuite>
<testsuite name="sync">
<directory prefix="test_" suffix=".php">tests/php/sync</directory>
<exclude>tests/php/sync/test_interface.jetpack-sync-replicastore.php</exclude>
</testsuite>
<testsuite name="sync-replicastore">
<file phpVersion="5.3.0" phpVersionOperator=">=">tests/php/sync/test_interface.jetpack-sync-replicastore.php</file>
</testsuite>
</testsuites>
<groups>
Expand Down
10 changes: 10 additions & 0 deletions tests/load-travis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

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