Skip to content

Instantly share code, notes, and snippets.

@bendavies
Created June 15, 2020 21:07
Show Gist options
  • Save bendavies/4864ce2e1e50657eb07b432024466eeb to your computer and use it in GitHub Desktop.
Save bendavies/4864ce2e1e50657eb07b432024466eeb to your computer and use it in GitHub Desktop.
#!/bin/bash
set -eu
mkdir -p build/logs/phpunit build/coverage
split_tests=$(find tests -name '*Test.php')
export PARALLEL='-j10% --joblog build/logs/parallel.log --rpl {_}\ s/\\//_/g;'
phpunit_cmd='TEST_TOKEN={%} vendor/bin/phpunit --coverage-php build/coverage/coverage-{_}.cov --log-junit build/logs/phpunit/{_}.xml --colors=always {}'
echo "$split_tests" | parallel "$phpunit_cmd"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment