Skip to content

Commit

Permalink
behat: Use dmarynicz/behat-parallel-extension to run tests in paralle…
Browse files Browse the repository at this point in the history
…l when BEHAT_PARALLEL is set
  • Loading branch information
dkoston committed Dec 11, 2024
1 parent e821347 commit 03d7be7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ default:
- WP_CLI\Tests\Context\FeatureContext
paths:
- features
extensions:
DMarynicz\BehatParallelExtension\Extension: ~
8 changes: 7 additions & 1 deletion bin/run-behat-tests
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ if [[ "$@" == *"--help"* ]]; then
exit $ret
fi

PARALLEL=""
if [[ -n "${BEHAT_PARALLEL}" ]]; then
PARALLEL="--parallel"
fi


# Turn WP_VERSION into an actual number to make sure our tags work correctly.
if [ "${WP_VERSION-latest}" = "latest" ]; then
export WP_VERSION=$(curl -s https://api.wordpress.org/core/version-check/1.7/ | jq -r ".offers[0].current")
Expand All @@ -45,4 +51,4 @@ export WP_CLI_TESTS_ROOT
BEHAT_TAGS=$(php "$WP_CLI_TESTS_ROOT"/utils/behat-tags.php)

# Run the functional tests.
vendor/bin/behat --format progress "$BEHAT_TAGS" --strict "$@"
vendor/bin/behat "${PARALLEL}" --format progress "$BEHAT_TAGS" --strict "$@"
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"php": ">=5.6",
"behat/behat": "^3.7",
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || ^0.5 || ^0.6.2 || ^0.7.1 || ^1.0.0",
"dmarynicz/behat-parallel-extension": "^1.0",
"php-parallel-lint/php-console-highlighter": "^1.0",
"php-parallel-lint/php-parallel-lint": "^1.3.1",
"phpcompatibility/php-compatibility": "dev-develop",
Expand Down

0 comments on commit 03d7be7

Please sign in to comment.