Build/Test Tools: Avoid running full PHPUnit test suite for every PHP file change.

Use `grunt watch --phpunit --group={testgroup}` to start `grunt watch` with a specific test group so that PHP file changes trigger a limited number of tests.

Props jeremyfelt, birgire for testing.
Fixes #44240.


git-svn-id: https://develop.svn.wordpress.org/trunk@43335 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jeremy Felt 2018-06-08 04:40:18 +00:00
parent a14e4f1c86
commit 8d9cd406fb
1 changed files with 7 additions and 4 deletions

View File

@ -1111,10 +1111,6 @@ module.exports = function(grunt) {
'!tests/qunit/editor/**'
],
tasks: ['qunit']
},
phpunit: {
files: [ '**/*.php' ],
tasks: [ 'phpunit:default' ]
}
}
});
@ -1160,6 +1156,13 @@ module.exports = function(grunt) {
grunt.task.run( 'build' );
}
if ( 'watch:phpunit' === grunt.cli.tasks[ 0 ] || 'undefined' !== typeof grunt.option( 'phpunit' ) ) {
grunt.config.data._watch.phpunit = {
files: [ '**/*.php' ],
tasks: [ 'phpunit:default' ]
};
}
grunt.task.run( '_' + this.nameArgs );
} );