Skip to content

Commit

Permalink
chore: improve run_e2e_tests script [skip app] [skip tests]
Browse files Browse the repository at this point in the history
  • Loading branch information
tristan-greffe committed Apr 4, 2024
1 parent b5cc6cb commit 07afb49
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion scripts/kash
Submodule kash updated 1 files
+5 −3 kash.sh
17 changes: 11 additions & 6 deletions scripts/run_e2e_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ set -euo pipefail

APP=$1
SLACK_WEBHOOK=$2
LINK=""

GOOGLE_LOGS_LINK=""
GOOGLE_SCREEN_LINK=""

CURRENT_DATE=$(date +"%d-%m-%Y")

Expand All @@ -17,13 +19,13 @@ ROOT_DIR=$(dirname "$THIS_DIR")
## Report outcome to slack
##

trap 'slack_e2e_report "$APP" "$?" "$SLACK_WEBHOOK" "$LINK"' EXIT
trap 'slack_e2e_report "$APP" "$?" "$SLACK_WEBHOOK" "$GOOGLE_LOGS_LINK" "$GOOGLE_SCREEN_LINK"' EXIT

## Run tests & redirect output to a log file
##

mkdir -p "$ROOT_DIR/test/run/chrome"
yarn test:client > "$ROOT_DIR/test/run/chrome/e2e_test_log.txt" 2>&1
yarn test:client > "$ROOT_DIR/test/run/chrome/google_logs.txt" 2>&1

# PUPPETEER_PRODUCT=firefox yarn add puppeteer
# yarn link "@kalisio/kdk" --link-folder /opt/kalisio/yarn-links
Expand All @@ -35,7 +37,10 @@ yarn test:client > "$ROOT_DIR/test/run/chrome/e2e_test_log.txt" 2>&1
##

cd "$ROOT_DIR/test"
zip -r "$ROOT_DIR/test/$CURRENT_DATE.zip" run
zip -r "$ROOT_DIR/test/screenshots_google.zip" run

rclone copy "$ROOT_DIR/test/run/chrome/google_log.txt" "ovh-s3:/dev/e2e_tests/$APP/$CURRENT_DATE"
GOOGLE_LOGS_LINK=$(rclone link "ovh-s3:/dev/e2e_tests/$APP/$CURRENT_DATE/google_log.txt")

rclone copy "$ROOT_DIR/test/$CURRENT_DATE.zip" "ovh-s3:/dev/e2e_tests/$APP"
LINK=$(rclone link "ovh-s3:/dev/e2e_tests/$APP/$CURRENT_DATE.zip")
rclone copy "$ROOT_DIR/test/screenshots_google.zip" "ovh-s3:/dev/e2e_tests/$APP/$CURRENT_DATE"
GOOGLE_SCREEN_LINK=$(rclone link "ovh-s3:/dev/e2e_tests/$APP/$CURRENT_DATE/screenshots_google.zip")

0 comments on commit 07afb49

Please sign in to comment.