2020-05-12 19:59:36 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
# By default we assume that the target for the CI is local
|
|
|
|
|
target=local
|
|
|
|
|
|
|
|
|
|
while :; do
|
|
|
|
|
case $1 in
|
|
|
|
|
-e|--env)
|
|
|
|
|
if [ "$2" ]; then
|
|
|
|
|
target=$2
|
|
|
|
|
shift
|
|
|
|
|
else
|
|
|
|
|
die 'ERROR: "--env" requires a non-empty option argument. Allowed values local/ci'
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
--env=?*)
|
|
|
|
|
target=${1#*=} # Delete everything up to "=" and assign the remainder.
|
|
|
|
|
;;
|
|
|
|
|
*) # Default case: No more options, so break out of the loop.
|
|
|
|
|
break
|
|
|
|
|
esac
|
|
|
|
|
shift
|
|
|
|
|
done
|
|
|
|
|
|
2021-02-22 04:48:30 +00:00
|
|
|
echo "Got the target: $target"
|
2020-05-12 19:59:36 +00:00
|
|
|
if [ "$target" == "ci" ]; then
|
|
|
|
|
# On the CI server run the tests in parallel
|
|
|
|
|
# This requires the projectId and the record_key to be configured in your environment variables. By default this is defined on the CI server
|
2020-06-10 11:14:58 +00:00
|
|
|
echo "Got the Build ID: $BUILD_ID"
|
2023-05-11 05:26:03 +00:00
|
|
|
yarn cypress run --headless \
|
2020-07-16 05:50:46 +00:00
|
|
|
--record --key "$CYPRESS_RECORD_KEY" --ci-build-id $BUILD_ID \
|
2020-06-10 11:14:58 +00:00
|
|
|
--parallel --group "Electrons on Gitlab CI" \
|
2023-01-25 05:39:02 +00:00
|
|
|
--spec "cypress/integration/Regression_TestSuite/**/*.js"
|
2020-05-12 19:59:36 +00:00
|
|
|
else
|
2023-05-11 05:26:03 +00:00
|
|
|
yarn cypress run --headless --browser chromium --spec "cypress/integration/Regression_TestSuite/**/*.js"
|
2021-02-22 04:48:30 +00:00
|
|
|
fi
|