forked from openshift/console
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-gui.sh
executable file
·43 lines (33 loc) · 926 Bytes
/
test-gui.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
#!/usr/bin/env bash
set -euo pipefail
source ./contrib/environment.sh
if [ -z "$BRIDGE_K8S_AUTH_BEARER_TOKEN" ];
then
echo "no BRIDGE_K8S_AUTH_BEARER_TOKEN!?"
exit 1
fi
if [ -z "$BRIDGE_K8S_MODE_OFF_CLUSTER_ENDPOINT" ];
then
echo "no BRIDGE_K8S_MODE_OFF_CLUSTER_ENDPOINT!?"
exit 1
fi
BRIDGE_BASE_PATH="/path-$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c10)/"
export BRIDGE_BASE_PATH
# TODO: eventually test auth
./bin/bridge \
--k8s-mode="off-cluster" \
--user-auth="disabled" \
--k8s-mode-off-cluster-skip-verify-tls=true \
--k8s-auth="bearer-token" \
--k8s-mode-off-cluster-endpoint="$BRIDGE_K8S_MODE_OFF_CLUSTER_ENDPOINT" \
--k8s-auth-bearer-token="$BRIDGE_K8S_AUTH_BEARER_TOKEN" &
echo $! > bridge.pid
cd frontend
yarn run webdriver-update --quiet > /dev/null 2>&1
if [ $# -gt 0 ] && [ -n "$1" ];
then
yarn run test-suite --suite "$1"
else
yarn run test-gui
fi
kill "$(cat ../bridge.pid)"