Make WordPress Core


Ignore:
Timestamp:
03/01/2021 08:21:23 PM (6 years ago)
Author:
johnbillion
Message:

Build/Test Tools: PHPUnit test improvements:

  • Switch back to running the PHPUnit test suite against the src directory instead of build
  • Increase the reliability of backing up the mu-plugins directory during tests
  • Split the PHPUnit tests for PHP versions below 7.0 in half, allowing them to run in parallel and reduce the overall test run duration on GitHub Actions

Merges [50441-50444] to the 5.7 branch.

Fixes #51734, #51735, #52645

Location:
branches/5.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.7

  • branches/5.7/tests/phpunit/includes/abstract-testcase.php

    r49916 r50464  
    12941294                );
    12951295        }
     1296
     1297        /**
     1298         * Touches the given file and its directory if it doesn't already exist.
     1299         *
     1300         * This can be used to ensure a file that is implictly relied on in a test exists
     1301         * without it having to be built.
     1302         *
     1303         * @param string $file The file name.
     1304         */
     1305        public static function touch( $file ) {
     1306                if ( file_exists( $file ) ) {
     1307                        return;
     1308                }
     1309
     1310                $dir = dirname( $file );
     1311
     1312                if ( ! file_exists( $dir ) ) {
     1313                        mkdir( $dir, 0777, true );
     1314                }
     1315
     1316                touch( $file );
     1317        }
    12961318}
Note: See TracChangeset for help on using the changeset viewer.