diff --git a/.travis.yml b/.travis.yml
index 4ce1344c09..18f1306784 100644
|
a
|
b
|
matrix: |
| 18 | 18 | env: WP_TRAVISCI=travis:js |
| 19 | 19 | - php: 7.3 |
| 20 | 20 | - php: 7.2 |
| | 21 | - php: 7.1 |
| | 22 | env: WP_TRAVISCI=travis:phpunit:coverage |
| 21 | 23 | - php: 7.1 |
| 22 | 24 | - php: 7.0 |
| 23 | 25 | env: WP_TEST_REPORTER=true |
| … |
… |
matrix: |
| 36 | 38 | - php: nightly |
| 37 | 39 | before_install: |
| 38 | 40 | - | |
| 39 | | if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then |
| | 41 | if [[ "$WP_TRAVISCI" == travis:phpunit* ]]; then |
| 40 | 42 | mysql -u root -e "CREATE DATABASE wordpress_tests;" |
| 41 | 43 | cp wp-tests-config-sample.php wp-tests-config.php |
| 42 | 44 | sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php |
| … |
… |
before_script: |
| 65 | 67 | fi |
| 66 | 68 | - | |
| 67 | 69 | # Install the specified version of PHPUnit depending on the PHP version: |
| 68 | | if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then |
| | 70 | if [[ "$WP_TRAVISCI" == travis:phpunit* ]]; then |
| 69 | 71 | case "$TRAVIS_PHP_VERSION" in |
| 70 | 72 | 7.3|7.2|7.1|nightly) |
| 71 | 73 | echo "Using PHPUnit 7.x" |
| … |
… |
after_script: |
| 123 | 125 | export WPT_TEST_DIR=$(pwd) |
| 124 | 126 | php test-runner/report.php |
| 125 | 127 | fi |
| | 128 | - | |
| | 129 | if [[ "$WP_TRAVISCI" == "travis:phpunit:coverage" ]]; then |
| | 130 | bash <(curl -s https://codecov.io/bash) |
| | 131 | fi |
| 126 | 132 | notifications: |
| 127 | 133 | slack: |
| 128 | 134 | rooms: |
diff --git a/Gruntfile.js b/Gruntfile.js
index a27fc2b735..e2ad76d53e 100644
|
a
|
b
|
module.exports = function(grunt) { |
| 9 | 9 | spawn = require( 'child_process' ).spawnSync, |
| 10 | 10 | SOURCE_DIR = 'src/', |
| 11 | 11 | BUILD_DIR = 'build/', |
| 12 | | WORKING_DIR = grunt.option( 'dev' ) ? SOURCE_DIR : BUILD_DIR, |
| | 12 | WORKING_DIR = grunt.option( 'dev' ) || 'travis:phpunit:coverage' === grunt.cli.tasks[ 0 ] ? SOURCE_DIR : BUILD_DIR, |
| 13 | 13 | BANNER_TEXT = '/*! This file is auto-generated */', |
| 14 | 14 | autoprefixer = require( 'autoprefixer' ), |
| 15 | 15 | nodesass = require( 'node-sass' ), |
| … |
… |
module.exports = function(grunt) { |
| 662 | 662 | 'restapi-jsclient': { |
| 663 | 663 | cmd: 'phpunit', |
| 664 | 664 | args: ['--verbose', '-c', 'phpunit.xml.dist', '--group', 'restapi-jsclient'] |
| | 665 | }, |
| | 666 | 'coverage': { |
| | 667 | cmd: 'phpdbg', |
| | 668 | args: [ '-qrr', '/home/travis/.composer/vendor/bin/phpunit', '--verbose', '-c', 'phpunit.xml.dist', '--coverage-clover', 'coverage.xml' ] |
| 665 | 669 | } |
| 666 | 670 | }, |
| 667 | 671 | uglify: { |
| … |
… |
module.exports = function(grunt) { |
| 1371 | 1375 | ] ); |
| 1372 | 1376 | |
| 1373 | 1377 | grunt.registerTask( 'build', function() { |
| 1374 | | if ( grunt.option( 'dev' ) ) { |
| | 1378 | if ( grunt.option( 'dev' ) || 'travis:phpunit:coverage' === grunt.cli.tasks[ 0 ] ) { |
| 1375 | 1379 | grunt.task.run( [ |
| 1376 | 1380 | 'build:js', |
| 1377 | 1381 | 'build:css', |
| … |
… |
module.exports = function(grunt) { |
| 1397 | 1401 | |
| 1398 | 1402 | // Testing tasks. |
| 1399 | 1403 | grunt.registerMultiTask('phpunit', 'Runs PHPUnit tests, including the ajax, external-http, and multisite tests.', function() { |
| | 1404 | if ( 'travis:phpunit:coverage' === grunt.cli.tasks[ 0 ] ) { |
| | 1405 | grunt.util.spawn({ |
| | 1406 | cmd: 'perl', |
| | 1407 | args: [ '-0777', '-pi', '-e', 's/\\s+<php>(.|\\n)*<\\/php>\\s//g', 'phpunit.xml.dist' ], |
| | 1408 | opts: {stdio: 'inherit'} |
| | 1409 | }, function () {} ); |
| | 1410 | } |
| 1400 | 1411 | grunt.util.spawn({ |
| 1401 | 1412 | cmd: this.data.cmd, |
| 1402 | 1413 | args: phpUnitWatchGroup ? this.data.args.concat( [ '--group', phpUnitWatchGroup ] ) : this.data.args, |
| … |
… |
module.exports = function(grunt) { |
| 1430 | 1441 | // Travis CI tasks. |
| 1431 | 1442 | grunt.registerTask('travis:js', 'Runs Javascript Travis CI tasks.', [ 'jshint:corejs', 'qunit:compiled' ]); |
| 1432 | 1443 | grunt.registerTask('travis:phpunit', 'Runs PHPUnit Travis CI tasks.', [ 'build', 'phpunit' ]); |
| | 1444 | grunt.registerTask('travis:phpunit:coverage', 'Runs PHPUnit Travis CI tasks.', [ 'build', 'phpunit:coverage' ]); |
| 1433 | 1445 | grunt.registerTask('travis:format', 'Runs Code formatting Travis CI tasks.', [ 'format:php:error' ]); |
| 1434 | 1446 | |
| 1435 | 1447 | // Patch task. |