From 089f8e6b2b174b6d26330c4a2b14e949ff61d844 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 19 Jan 2023 15:42:22 +0100 Subject: [PATCH] Add check for all env variables (fail fast). --- .maestro/allTests.yaml | 2 ++ .maestro/scripts/checkEnv.js | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 .maestro/scripts/checkEnv.js diff --git a/.maestro/allTests.yaml b/.maestro/allTests.yaml index 8283e9fed5..cd3ca342e2 100644 --- a/.maestro/allTests.yaml +++ b/.maestro/allTests.yaml @@ -1,5 +1,7 @@ appId: ${APP_ID} --- +## Check that all env variables required in the whole test suite are declared (to fail faster) +- runScript: ./scripts/checkEnv.js - runFlow: tests/init.yaml - runFlow: tests/account/login.yaml - runFlow: tests/settings/settings.yaml diff --git a/.maestro/scripts/checkEnv.js b/.maestro/scripts/checkEnv.js new file mode 100644 index 0000000000..74b4b56956 --- /dev/null +++ b/.maestro/scripts/checkEnv.js @@ -0,0 +1,9 @@ +// This array contains all the required environment variable. When adding a variable, add it here also. +// If a variable is missing, an error will occur. + +if (APP_ID == null) throw "Fatal: missing env variable APP_ID" +if (USERNAME == null) throw "Fatal: missing env variable USERNAME" +if (PASSWORD == null) throw "Fatal: missing env variable PASSWORD" +if (ROOM_NAME == null) throw "Fatal: missing env variable ROOM_NAME" +if (INVITEE1_MXID == null) throw "Fatal: missing env variable INVITEE1_MXID" +if (INVITEE2_MXID == null) throw "Fatal: missing env variable INVITEE2_MXID"