Skip to content

Commit e5402dd

Browse files
authored
Move CI test script to repo (#68280)
Having it in openshift/release is inconvenient, as it often needs to be modifies. It should just rely on the Makefile target like the install step. For now that target doesn't exist, but it will be added in. Doesn't matter because the CI doesn't work anyway. rh-ecosystem-edge/assisted-chat#126
1 parent 9e81d0a commit e5402dd

File tree

1 file changed

+1
-49
lines changed

1 file changed

+1
-49
lines changed

ci-operator/step-registry/rh-ecosystem-edge/assisted-chat/test/rh-ecosystem-edge-assisted-chat-test-commands.sh

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,54 +4,6 @@ set -o nounset
44
set -o errexit
55
set -o pipefail
66

7-
87
oc create namespace $NAMESPACE || true
98

10-
oc create secret generic -n $NAMESPACE assisted-chat-ssl-ci --from-file=client_id=/var/run/secrets/sso-ci/client_id \
11-
--from-file=client_secret=/var/run/secrets/sso-ci/client_secret
12-
13-
oc process -p IMAGE_NAME=$ASSISTED_CHAT_TEST -p GEMINI_API_SECRET_NAME=gemini-api-key -p SSL_CLIENT_SECRET_NAME=assisted-chat-ssl-ci -f test/prow/template.yaml --local | oc apply -n $NAMESPACE -f -
14-
15-
sleep 5
16-
oc get pods -n $NAMESPACE
17-
POD_NAME=$(oc get pods | tr -s ' ' | cut -d ' ' -f1| grep assisted-chat-eval-tes)
18-
19-
TIMEOUT=600
20-
ELAPSED=0
21-
22-
while [ $ELAPSED -lt $TIMEOUT ]; do
23-
# Check if the pod's status is "Running"
24-
CURRENT_STATUS=$(oc get pod "$POD_NAME" -n "$NAMESPACE" -o=jsonpath='{.status.phase}')
25-
CURRENT_RESTARTS=$(oc get pod "$POD_NAME" -n "$NAMESPACE" -o=jsonpath='{.status.containerStatuses[0].restartCount}')
26-
if [[ $CURRENT_RESTARTS -gt 0 ]]; then
27-
echo "Pod ${POD_NAME} was restarted, so the tests should run at least once, exiting"
28-
oc logs -n $NAMESPACE $POD_NAME
29-
exit "$(oc get pod "$POD_NAME" -n "$NAMESPACE" -o=jsonpath='{.status.containerStatuses[0].lastState.terminated.exitCode}')"
30-
fi
31-
if [[ "$CURRENT_STATUS" == "Succeeded" ]]; then
32-
echo "Pod ${POD_NAME} is successfully completed, exiting"
33-
oc logs -n $NAMESPACE $POD_NAME
34-
exit 0
35-
fi
36-
if [[ "$CURRENT_STATUS" == "Completed" ]]; then
37-
echo "Pod ${POD_NAME} is successfully completed, exiting"
38-
oc logs -n $NAMESPACE $POD_NAME
39-
exit 0
40-
fi
41-
42-
if [[ "$CURRENT_STATUS" == "Failed" ]]; then
43-
echo "Pod ${POD_NAME} is Failed, exiting"
44-
oc logs -n $NAMESPACE $POD_NAME
45-
exit "$(oc get pod "$POD_NAME" -n "$NAMESPACE" -o=jsonpath='{.status.containerStatuses[0].lastState.terminated.exitCode}')"
46-
fi
47-
48-
echo "Waiting for pod $POD_NAME to be ready..."
49-
sleep 1
50-
ELAPSED=$((ELAPSED + 1))
51-
done
52-
53-
oc logs -n $NAMESPACE $POD_NAME
54-
55-
echo "Timeout reached. Pod $POD_NAME did not become ready in time."
56-
exit 1
57-
9+
make ci-test

0 commit comments

Comments
 (0)