forked from redhat-developer/odo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenshiftci-presubmit-all-tests.sh
executable file
·62 lines (50 loc) · 1.68 KB
/
openshiftci-presubmit-all-tests.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
53
54
55
56
57
58
59
60
61
62
#!/bin/sh
# This file is used for InterOP testing, i.e. testing odo with unreleased OpenShift versions.
# fail if some commands fails
set -e
# show commands
set -x
ARCH=$(uname -m)
export CI="openshift"
if [ "${ARCH}" == "s390x" ]; then
make configure-installer-tests-cluster-s390x
elif [ "${ARCH}" == "ppc64le" ]; then
make configure-installer-tests-cluster-ppc64le
else
make configure-installer-tests-cluster
fi
make bin
mkdir -p $GOPATH/bin
export PATH="$PATH:$(pwd):$GOPATH/bin"
export CUSTOM_HOMEDIR=$ARTIFACT_DIR
# Copy kubeconfig to temporary kubeconfig file
# Read and Write permission to temporary kubeconfig file
TMP_DIR=$(mktemp -d)
cp $KUBECONFIG $TMP_DIR/kubeconfig
chmod 640 $TMP_DIR/kubeconfig
export KUBECONFIG=$TMP_DIR/kubeconfig
# Login as developer
oc login -u developer -p password@123 --insecure-skip-tls-verify
# Check login user name for debugging purpose
oc whoami
# We want to use a stable Devfile registry for InterOP testing, and so we use the custom Devfile Registry setup on IBM cloud
source ./scripts/openshiftci-config.sh
# Integration tests
# Service Binding Operator deprecated as of Feb 2024
make test-integration-openshift-no-service-binding || error=true
# Login again (in case the token expires for some reason)
oc login -u developer -p password@123 --insecure-skip-tls-verify || true
oc whoami
# E2e tests
# Service Binding Operator deprecated as of Feb 2024
make test-e2e-no-service-binding || error=true
# Fail the build if there is any error while test execution
if [ $error ]; then
exit -1
fi
if [ ! -z "$ARTIFACT_DIR" ]
then
#copy artifact to $ARTIFACT_DIR if ARTIFACT_DIR var is exposed
cp -vr test-*.xml $ARTIFACT_DIR || true
fi
oc logout