Skip to content

Commit ecbf4ff

Browse files
committed
Add db type as suffix
1 parent 98a69af commit ecbf4ff

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/Context/FeatureContext.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,7 @@ public function proc( $command, $assoc_args = [], $path = '' ) {
919919
}
920920

921921
$env = self::get_process_env_variables();
922+
922923
if ( isset( $this->variables['SUITE_CACHE_DIR'] ) ) {
923924
$env['WP_CLI_CACHE_DIR'] = $this->variables['SUITE_CACHE_DIR'];
924925
}
@@ -929,13 +930,14 @@ public function proc( $command, $assoc_args = [], $path = '' ) {
929930

930931
if ( self::$feature ) {
931932
$env['BEHAT_FEATURE_TITLE'] = self::$feature->getTitle();
932-
933933
}
934+
934935
if ( $this->scenario ) {
935936
$env['BEHAT_SCENARIO_TITLE'] = $this->scenario->getTitle();
936-
937937
}
938938

939+
$env['WP_CLI_TEST_DBTYPE'] = self::$db_type;
940+
939941
if ( isset( $this->variables['RUN_DIR'] ) ) {
940942
$cwd = "{$this->variables['RUN_DIR']}/{$path}";
941943
} else {

utils/maybe-generate-wp-cli-coverage.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ static function () use ( $coverage, $feature, $scenario, $name ) {
3434

3535
$feature_suffix = preg_replace( '/[^a-z0-9]+/', '-', strtolower( $feature ) );
3636
$scenario_suffix = preg_replace( '/[^a-z0-9]+/', '-', strtolower( $scenario ) );
37-
$filename = "clover-behat/{$feature_suffix}-{$scenario_suffix}.xml";
38-
$destination = "{$project_dir}/build/logs/{$filename}";
37+
$db_type = strtolower( getenv( 'WP_CLI_TEST_DBTYPE' ) );
38+
$filename = "clover-behat/$feature_suffix-$scenario_suffix-$db_type.xml";
39+
$destination = "$project_dir/build/logs/{$filename}";
3940

4041
( new Clover() )->process( $coverage, $destination, $name );
4142
}

0 commit comments

Comments
 (0)