-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
52 lines (43 loc) · 1.36 KB
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#! /usr/bin/env bash
set -Eeuo pipefail
RUNGUTAN_WAIT_FINISH=false
export RUNGUTAN_WAIT_FINISH
RUNGUTAN_WAIT_FINISH_LOWERCASE=false
export RUNGUTAN_WAIT_FINISH_LOWERCASE
if [ -z "$RUNGUTAN_TEAM_ID" ]; then
echo "RUNGUTAN_TEAM_ID is not set"
exit 1
fi
if [ -z "$RUNGUTAN_API_KEY" ]; then
echo "RUNGUTAN_API_KEY is not set"
exit 1
fi
if [ -z "$RUNGUTAN_TEST_FILE" ]; then
echo "RUNGUTAN_TEST_FILE is not set"
exit 1
fi
if [[ ! -f "$RUNGUTAN_TEST_FILE" ]]; then
echo "${RUNGUTAN_TEST_FILE} does not exist"
fi
if [ -z "$RUNGUTAN_WAIT_FINISH" ]; then
RUNGUTAN_WAIT_FINISH_LOWERCASE=$(echo "$RUNGUTAN_WAIT_FINISH" | awk '{print tolower($0)}')
fi
export RUNGUTAN_TEAM_ID
export RUNGUTAN_API_KEY
export RUNGUTAN_TEST_FILE
export RUNGUTAN_WAIT_FINISH_LOWERCASE
echo "Running load test on $GITHUB_REPOSITORY with run_id $GITHUB_RUN_ID"
if [ -z "$RUNGUTAN_TEST_NAME" ]; then
if [ "$RUNGUTAN_WAIT_FINISH_LOWERCASE" == "true" ]; then
rungutan tests add --test_file ${RUNGUTAN_TEST_FILE} --wait_to_finish
else
rungutan tests add --test_file ${RUNGUTAN_TEST_FILE}
fi
else
export RUNGUTAN_TEST_NAME
if [ "$RUNGUTAN_WAIT_FINISH_LOWERCASE" == "true" ]; then
rungutan tests add --test_file ${RUNGUTAN_TEST_FILE} --wait_to_finish --test_name ${RUNGUTAN_TEST_NAME}
else
rungutan tests add --test_file ${RUNGUTAN_TEST_FILE} --test_name ${RUNGUTAN_TEST_NAME}
fi
fi