-
Notifications
You must be signed in to change notification settings - Fork 27
Setup & teardown hardening #320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -450,11 +450,12 @@ private static function get_process_env_variables(): array { | |||||||||||
| $path_separator = Utils\is_windows() ? ';' : ':'; | ||||||||||||
| $php_binary_path = dirname( PHP_BINARY ); | ||||||||||||
| $env = [ | ||||||||||||
| 'PATH' => $php_binary_path . $path_separator . $bin_path . $path_separator . getenv( 'PATH' ), | ||||||||||||
| 'BEHAT_RUN' => 1, | ||||||||||||
| 'HOME' => sys_get_temp_dir() . '/wp-cli-home', | ||||||||||||
| 'COMPOSER_HOME' => sys_get_temp_dir() . '/wp-cli-composer-home', | ||||||||||||
| 'TEST_RUN_DIR' => self::$behat_run_dir, | ||||||||||||
| 'PATH' => $php_binary_path . $path_separator . $bin_path . $path_separator . getenv( 'PATH' ), | ||||||||||||
| 'BEHAT_RUN' => 1, | ||||||||||||
| 'HOME' => sys_get_temp_dir() . '/wp-cli-home', | ||||||||||||
| 'COMPOSER_HOME' => sys_get_temp_dir() . '/wp-cli-composer-home', | ||||||||||||
| 'TEST_RUN_DIR' => self::$behat_run_dir, | ||||||||||||
| 'WP_CLI_SKIP_PROMPT' => 'no', | ||||||||||||
| ]; | ||||||||||||
|
|
||||||||||||
| $env = array_merge( $_ENV, $env ); | ||||||||||||
|
|
@@ -745,8 +746,10 @@ public function beforeScenario( BeforeScenarioScope $scope ): void { | |||||||||||
| public function afterScenario( AfterScenarioScope $scope ): void { | ||||||||||||
|
|
||||||||||||
| if ( self::$run_dir ) { | ||||||||||||
| // Remove altered WP install, unless there's an error. | ||||||||||||
| if ( $scope->getTestResult()->getResultCode() <= 10 ) { | ||||||||||||
| // Remove altered WP install, unless there's an error (and we are not on CI). | ||||||||||||
| $is_ci = getenv( 'CI' ); | ||||||||||||
| $is_debug = getenv( 'WP_CLI_TEST_DEBUG_BEHAT_ENV' ); | ||||||||||||
| if ( $scope->getTestResult()->getResultCode() <= 10 || ( $is_ci && ! $is_debug ) ) { | ||||||||||||
swissspidy marked this conversation as resolved.
Show resolved
Hide resolved
Comment on lines
+750
to
+752
|
||||||||||||
| $is_ci = getenv( 'CI' ); | |
| $is_debug = getenv( 'WP_CLI_TEST_DEBUG_BEHAT_ENV' ); | |
| if ( $scope->getTestResult()->getResultCode() <= 10 || ( $is_ci && ! $is_debug ) ) { | |
| $is_ci = getenv( 'CI' ); | |
| if ( $scope->getTestResult()->getResultCode() <= 10 || $is_ci ) { |
Uh oh!
There was an error while loading. Please reload this page.