Skip to content

Commit 05f7dbc

Browse files
wip: add link to latest e2e test if possible
1 parent c49f626 commit 05f7dbc

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

kash.sh

+11-2
Original file line numberDiff line numberDiff line change
@@ -1715,13 +1715,14 @@ run_e2e_tests () {
17151715
# Chrome
17161716
mkdir -p "$TESTS_RESULTS"
17171717
yarn test:client 2>&1 | tee "$TESTS_RESULTS/logs.txt"
1718+
local RET="${PIPESTATUS[0]}"
17181719

17191720
# Firefox
17201721
# PUPPETEER_PRODUCT=firefox yarn add puppeteer
17211722
# yarn link "@kalisio/kdk" --link-folder /opt/kalisio/yarn-links
17221723
# export BROWSER="firefox"bucket
17231724
# mkdir -p "$ROOT_DIR/test/run/firefox"
1724-
return $? # return the exit code of the tests
1725+
return "$RET" # return the exit code of the tests
17251726
}
17261727

17271728
# Upload e2e tests artefacts to some s3 storage.
@@ -1896,6 +1897,14 @@ push_e2e_tests_report_to_git_repo() {
18961897
mkdir -p "$REPORT_DIR"
18971898

18981899
cp "$REPORT_FILE" "$REPORT_DIR"
1900+
1901+
# Try add link to 'latest' section
1902+
local LATEST_REPORT
1903+
LATEST_REPORT=$(realpath --relative-to="$WORK_DIR" "$REPORT_FILE")
1904+
1905+
# It's ok if this fails
1906+
sed -i 's/^['"$APP"' e2e](.*)$/['"$APP"' e2e]('"$LATEST_REPORT"')/' "$WORK_DIR/README.md" || true
1907+
18991908
cd "$WORK_DIR"
19001909
git add --all
19011910
git -c user.name="CI bot" -c user.email="[email protected]" commit --message "ci: e2e tests report from $TIMESTAMP"
@@ -1922,7 +1931,7 @@ run_and_publish_e2e_tests_to_git_repo() {
19221931
local REPOSITORY_URL="$5"
19231932
local REPORTS_BASE="$6"
19241933

1925-
run_e2e_tests "$ROOT_DIR" "$APP"
1934+
run_e2e_tests "$ROOT_DIR" "$APP" || true
19261935

19271936
local MD_FLAVOR
19281937
[[ "$REPOSITORY_URL" = *gitlab* ]] && MD_FLAVOR="gitlab"

0 commit comments

Comments
 (0)