From fece2cae80503d22b9cb0e6ba5e9d837f27ce930 Mon Sep 17 00:00:00 2001 From: Igor Zinovyev Date: Tue, 11 Jun 2024 14:57:49 +0300 Subject: [PATCH] Adding GitHub CI WordPress env compatibility. --- projects/plugins/wpcomsh/tests/bootstrap.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/projects/plugins/wpcomsh/tests/bootstrap.php b/projects/plugins/wpcomsh/tests/bootstrap.php index c7d985630150b..65deda4e9841a 100644 --- a/projects/plugins/wpcomsh/tests/bootstrap.php +++ b/projects/plugins/wpcomsh/tests/bootstrap.php @@ -7,13 +7,22 @@ $_tests_dir = getenv( 'WP_TESTS_DIR' ); $_core_dir = getenv( 'WP_CORE_DIR' ); +$wp_branch = getenv( 'WP_BRANCH' ); if ( ! $_tests_dir ) { - $_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib'; + if ( $wp_branch ) { + $_tests_dir = '/tmp/wordpress-' . $wp_branch; + } else { + $_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib'; + } } if ( ! $_core_dir ) { - $_core_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress/'; + if ( $wp_branch ) { + $_core_dir = '/tmp/wordpress-' . $wp_branch . '/src'; + } else { + $_core_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress/'; + } } define( 'IS_ATOMIC', true );