Skip to content

Commit d37afa8

Browse files
committed
Conditionally pass Behat --xdebug flag
1 parent 197c05e commit d37afa8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bin/run-behat-tests

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,10 @@ export WP_CLI_TESTS_ROOT
4444
# Generate the tags to apply environment-specific filters.
4545
BEHAT_TAGS=$(php "$WP_CLI_TESTS_ROOT"/utils/behat-tags.php)
4646

47+
BEHAT_EXTRA_ARGS=()
48+
if [[ "${WP_CLI_TEST_COVERAGE}" == "true" ]] && vendor/bin/behat --help 2>/dev/null | grep -q 'xdebug'; then
49+
BEHAT_EXTRA_ARGS+=('--xdebug')
50+
fi
51+
4752
# Run the functional tests.
48-
vendor/bin/behat --format progress "$BEHAT_TAGS" --strict "$@"
53+
vendor/bin/behat --format progress "$BEHAT_TAGS" --strict "${BEHAT_EXTRA_ARGS[@]}" "$@"

0 commit comments

Comments
 (0)