Created
February 21, 2019 09:35
-
-
Save willmendesneto/39e6bd7f3a24962419102178139661e1 to your computer and use it in GitHub Desktop.
Running browserstack integration tests in parallel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this script should be called from package.json | |
# If required, add the `node_modules/.bin` content into your PATH variable | |
# | |
# Usage: | |
# chmod +x ./run-integration-tests-in-parallel.sh | |
# ./run-integration-tests-in-parallel.sh | |
# get files in folders | |
files=$(find packages/**/**/__tests__/integration -type f -name "*.js" -exec basename \{\} .js \;) | |
cmd="concurrently " | |
# go through all files in test folder and generate commands for each, then execute | |
for file in ${files} | |
do | |
# adding the commands per file | |
single_cmd="--names \"${files}\" --name-separator \" \" \"yarn run " | |
single_cmd="${single_cmd} test:e2e-browserstack -- --filter **/${file}.js \" "; | |
# combine all the single commands to use concurrently | |
cmd="${cmd}${single_cmd}" | |
done | |
eval $cmd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment