From 0394aab7a8349d6ce61078e9f6039751e12d4f73 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Thu, 10 Jan 2019 02:18:19 +0000 Subject: [PATCH] Tests: Add support for a `WP_TESTS_SKIP_INSTALL` environment variable. Defining `WP_TESTS_SKIP_INSTALL=1` when running tests will skip the install step. While this shouldn't be used for full test runs, it's useful for saving time when running small groups of tests. Props soulseekah. Fixes #43432. git-svn-id: https://develop.svn.wordpress.org/trunk@44536 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/includes/bootstrap.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/includes/bootstrap.php b/tests/phpunit/includes/bootstrap.php index 47c59528be..35ab16ca04 100644 --- a/tests/phpunit/includes/bootstrap.php +++ b/tests/phpunit/includes/bootstrap.php @@ -76,9 +76,11 @@ if ( file_exists( DIR_TESTDATA . '/themedir1' ) ) { $wp_theme_directories[] = DIR_TESTDATA . '/themedir1'; } -system( WP_PHP_BINARY . ' ' . escapeshellarg( dirname( __FILE__ ) . '/install.php' ) . ' ' . escapeshellarg( $config_file_path ) . ' ' . $multisite, $retval ); -if ( 0 !== $retval ) { - exit( $retval ); +if ( '1' !== getenv( 'WP_TESTS_SKIP_INSTALL' ) ) { + system( WP_PHP_BINARY . ' ' . escapeshellarg( dirname( __FILE__ ) . '/install.php' ) . ' ' . escapeshellarg( $config_file_path ) . ' ' . $multisite, $retval ); + if ( 0 !== $retval ) { + exit( $retval ); + } } if ( $multisite ) {