|
1 | 1 | #!/usr/bin/bash |
| 2 | +set -euo pipefail |
2 | 3 |
|
3 | 4 | export EXTERNAL_TEST="true" |
4 | 5 | export PATTERN_NAME="MultiCloudGitops" |
5 | 6 | export PATTERN_SHORTNAME="mcgitops" |
6 | 7 |
|
7 | | -if [ -z "${KUBECONFIG}" ]; then |
| 8 | +if [ -z "${KUBECONFIG:-}" ]; then |
8 | 9 | echo "No kubeconfig file set for hub cluster" |
9 | 10 | exit 1 |
10 | 11 | fi |
11 | 12 |
|
12 | | -if [ -z "${KUBECONFIG_EDGE}" ]; then |
| 13 | +if [ -z "${KUBECONFIG_EDGE:-}" ]; then |
13 | 14 | echo "No kubeconfig file set for edge cluster" |
14 | 15 | exit 1 |
15 | 16 | fi |
16 | 17 |
|
17 | | -if [ -z "${INFRA_PROVIDER}" ]; then |
| 18 | +if [ -z "${INFRA_PROVIDER:-}" ]; then |
18 | 19 | echo "INFRA_PROVIDER is not defined" |
19 | 20 | exit 1 |
20 | 21 | fi |
21 | 22 |
|
22 | | -if [ -z "${WORKSPACE}" ]; then |
23 | | - export WORKSPACE=/tmp |
| 23 | +if [ -z "${WORKSPACE:-}" ]; then |
| 24 | + WORKSPACE=$(mktemp -d) |
| 25 | + export WORKSPACE |
| 26 | + echo "WORKSPACE not set, using temporary directory: ${WORKSPACE}" |
24 | 27 | fi |
25 | 28 |
|
26 | | -pytest -lv --disable-warnings test_subscription_status_hub.py --kubeconfig $KUBECONFIG --junit-xml $WORKSPACE/test_subscription_status_hub.xml |
| 29 | +pytest -lv --disable-warnings test_subscription_status_hub.py --kubeconfig "$KUBECONFIG" --junit-xml "$WORKSPACE/test_subscription_status_hub.xml" |
27 | 30 |
|
28 | | -pytest -lv --disable-warnings test_subscription_status_edge.py --kubeconfig $KUBECONFIG_EDGE --junit-xml $WORKSPACE/test_subscription_status_edge.xml |
| 31 | +pytest -lv --disable-warnings test_subscription_status_edge.py --kubeconfig "$KUBECONFIG_EDGE" --junit-xml "$WORKSPACE/test_subscription_status_edge.xml" |
29 | 32 |
|
30 | | -pytest -lv --disable-warnings test_validate_hub_site_components.py --kubeconfig $KUBECONFIG --junit-xml $WORKSPACE/test_validate_hub_site_components.xml |
| 33 | +pytest -lv --disable-warnings test_validate_hub_site_components.py --kubeconfig "$KUBECONFIG" --junit-xml "$WORKSPACE/test_validate_hub_site_components.xml" |
31 | 34 |
|
32 | | -pytest -lv --disable-warnings test_validate_edge_site_components.py --kubeconfig $KUBECONFIG_EDGE --junit-xml $WORKSPACE/test_validate_edge_site_components.xml |
| 35 | +pytest -lv --disable-warnings test_validate_edge_site_components.py --kubeconfig "$KUBECONFIG_EDGE" --junit-xml "$WORKSPACE/test_validate_edge_site_components.xml" |
33 | 36 |
|
34 | | -pytest -lv --disable-warnings test_modify_web_content.py --kubeconfig $KUBECONFIG --junit-xml $WORKSPACE/test_modify_web_content.xml |
| 37 | +pytest -lv --disable-warnings test_modify_web_content.py --kubeconfig "$KUBECONFIG" --junit-xml "$WORKSPACE/test_modify_web_content.xml" |
35 | 38 |
|
36 | 39 | python3 create_ci_badge.py |
0 commit comments