-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d920255
commit 76678ab
Showing
3 changed files
with
24 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,46 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
set -uo pipefail | ||
# set -x | ||
|
||
APP=$1 | ||
SLACK_WEBHOOK=$2 | ||
|
||
GOOGLE_LOGS_LINK="https://github.com/kalisio" | ||
SCREEN_LINK="https://github.com/kalisio" | ||
|
||
CURRENT_DATE=$(date +"%d-%m-%Y") | ||
|
||
THIS_FILE=$(readlink -f "${BASH_SOURCE[0]}") | ||
THIS_DIR=$(dirname "$THIS_FILE") | ||
ROOT_DIR=$(dirname "$THIS_DIR") | ||
|
||
. "$THIS_DIR/kash/kash.sh" | ||
|
||
## Report outcome to slack | ||
## | ||
|
||
trap 'slack_e2e_report "$APP" "$?" "$SLACK_WEBHOOK" "$GOOGLE_LOGS_LINK" "$SCREEN_LINK"' EXIT | ||
|
||
## Run tests & redirect output to a log file | ||
## | ||
|
||
# Chrome | ||
mkdir -p "$ROOT_DIR/test/run/chrome" | ||
yarn test:client > "$ROOT_DIR/test/run/chrome/google_logs.txt" 2>&1 | ||
yarn test:client > "$ROOT_DIR/test/run/chrome/chrome_logs.txt" 2>&1 | ||
RET_CODE=$? | ||
|
||
# Firefox | ||
# PUPPETEER_PRODUCT=firefox yarn add puppeteer | ||
# yarn link "@kalisio/kdk" --link-folder /opt/kalisio/yarn-links | ||
# yarn link "@kalisio/kdk" --link-folder /opt/kalisio/yarn-links | ||
# export BROWSER="firefox"bucket | ||
# mkdir -p "$ROOT_DIR/test/run/firefox" | ||
# yarn test:client | ||
# yarn test:client > "$ROOT_DIR/test/run/chrome/firefox_logs.txt" 2>&1 | ||
|
||
## Upload logs & screenshots to S3 | ||
## | ||
|
||
zip -r "$ROOT_DIR/test/screenshots.zip" run | ||
CURRENT_DATE=$(date +"%d-%m-%Y") | ||
CHROME_LOGS_LINK="" | ||
SCREEN_LINK="" | ||
|
||
zip -r "$ROOT_DIR/test/screenshots.zip" "$ROOT_DIR/test/run" | ||
|
||
rclone copy "$ROOT_DIR/test/run/chrome/google_logs.txt" "ovh-s3:/dev/e2e-tests/$APP/$CURRENT_DATE" | ||
GOOGLE_LOGS_LINK=$(rclone link "ovh-s3:/dev/e2e-tests/$APP/$CURRENT_DATE/google_logs.txt") | ||
rclone copy "$ROOT_DIR/test/run/chrome/chrome_logs.txt" "ovh-s3:/dev/e2e-tests/$APP/$CURRENT_DATE" | ||
CHROME_LOGS_LINK=$(rclone link "ovh-s3:/dev/e2e-tests/$APP/$CURRENT_DATE/chrome_logs.txt") | ||
|
||
rclone copy "$ROOT_DIR/test/screenshots.zip" "ovh-s3:/dev/e2e-tests/$APP/$CURRENT_DATE" | ||
SCREEN_LINK=$(rclone link "ovh-s3:/dev/e2e-tests/$APP/$CURRENT_DATE/screenshots.zip") | ||
SCREEN_LINK=$(rclone link "ovh-s3:/dev/e2e-tests/$APP/$CURRENT_DATE/screenshots.zip") | ||
|
||
## Report outcome to slack | ||
## | ||
|
||
slack_e2e_report "$APP" "$RET_CODE" "$SLACK_WEBHOOK" "$CHROME_LOGS_LINK" "$SCREEN_LINK" |