[e2e tests] Add an option to skip the env setup script when running tests (#50620)
Add the -x option to skip executing the env setup script
This commit is contained in:
parent
3a363d232b
commit
f91bcf44c7
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: dev
|
||||
|
||||
E2E tests: add an option to skip the env setup script running before test execution
|
|
@ -2,6 +2,22 @@
|
|||
|
||||
set -eo pipefail
|
||||
|
||||
skipEnvSetup=False
|
||||
|
||||
while getopts "x" opt; do
|
||||
case $opt in
|
||||
x)
|
||||
skipEnvSetup=True
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $((OPTIND-1))
|
||||
|
||||
envName=$1
|
||||
shift
|
||||
|
||||
|
@ -12,7 +28,6 @@ SCRIPT_PATH=$(
|
|||
|
||||
echo "Setting up environment: $envName"
|
||||
|
||||
|
||||
if [ -f "$SCRIPT_PATH/envs/$envName/.env.enc" ]; then
|
||||
echo "Found encrypted .env file for environment '$envName'"
|
||||
"$SCRIPT_PATH/bin/dotenv.sh" -d "$envName"
|
||||
|
@ -22,7 +37,12 @@ else
|
|||
rm -f "$SCRIPT_PATH/.env"
|
||||
fi
|
||||
|
||||
"$SCRIPT_PATH/envs/$envName/env-setup.sh"
|
||||
if [ "$skipEnvSetup" == "True" ]; then
|
||||
echo "Skipping environment setup"
|
||||
else
|
||||
echo "Executing environment setup script(s)"
|
||||
"$SCRIPT_PATH/envs/$envName/env-setup.sh"
|
||||
fi
|
||||
|
||||
echo "Running tests with environment: '$envName'"
|
||||
echo "Arguments: $*"
|
||||
|
|
Loading…
Reference in New Issue