Skip to content

Commit 4e55c21

Browse files
committed
[tests] Update test cluster setup and configuration
Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
1 parent e6a8b7b commit 4e55c21

File tree

1 file changed

+53
-9
lines changed

1 file changed

+53
-9
lines changed

.github/workflows/continuous-integration-workflow.yml

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,28 +57,72 @@ jobs:
5757
NODE_OPTIONS: --max_old_space_size=16384
5858
run: xvfb-run npm run test:coverage --silent
5959

60+
# Install and start KinD cluster
6061
- name: Start KinD cluster
6162
if: (success() || failure()) && runner.os == 'Linux'
6263
uses: helm/kind-action@v1.14.0
6364
with:
6465
version: v0.31.0
6566
node_image: kindest/node:v1.34.0
6667

68+
# Configure cluster
6769
- name: Configure cluster
6870
if: (success() || failure()) && runner.os == 'Linux'
6971
run: |
70-
curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.19.1/install.sh | bash -s v0.19.1
71-
kubectl create -f https://operatorhub.io/install/service-binding-operator.yaml
72-
kubectl create -f https://operatorhub.io/install/cloudnative-pg.yaml
73-
nb=0
74-
echo -n "Waiting for operator to show up "
75-
while [ "$nb" != "2" ]
76-
do
72+
set -euo pipefail
73+
74+
echo "Installing CloudNativePG..."
75+
kubectl create -f https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-1.28/releases/cnpg-1.28.1.yaml
76+
77+
echo "Installing OLM (for SBO)..."
78+
kubectl create -f https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.42.0/crds.yaml
79+
kubectl create -f https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.42.0/olm.yaml
80+
81+
kubectl wait --for=condition=Available deployment -n olm --all --timeout=180s
82+
83+
echo "Installing Service Binding Operator via OLM..."
84+
kubectl apply -f https://operatorhub.io/install/service-binding-operator.yaml
85+
86+
echo "Waiting for operators..."
87+
88+
# CNPG
89+
kubectl wait --for=condition=Available deployment -n cnpg-system --all --timeout=180s
90+
91+
# OLM async flow
92+
echo "Waiting for Service Binding Operator CSV to appear..."
93+
94+
timeout=300
95+
elapsed=0
96+
97+
while true; do
98+
if kubectl get csv -n operators 2>/dev/null | grep -q service-binding-operator; then
99+
break
100+
fi
101+
77102
echo -n "."
78103
sleep 1
79-
nb=`kubectl get pods -n operators --no-headers --ignore-not-found | grep Running | wc -l`
104+
elapsed=$((elapsed+2))
105+
106+
if [ "$elapsed" -ge "$timeout" ]; then
107+
echo "❌ Timeout waiting for Service Binding Operator CSV"
108+
kubectl get subscription -n operators || true
109+
kubectl get installplan -n operators || true
110+
kubectl get csv -n operators || true
111+
kubectl get pods -n operators || true
112+
exit 1
113+
fi
80114
done
81-
echo CLUSTER_URL=`kubectl cluster-info | sed -n -e "s/\x1B\[[0-9;]*[a-zA-Z]//g" -e '1s/.*running at \(.*\)$/\1/p'` >> $GITHUB_ENV
115+
116+
echo "Waiting for Service Binding Operator CSV to succeed..."
117+
kubectl wait --for=jsonpath='{.status.phase}'=Succeeded \
118+
csv -n operators --all --timeout=300s
119+
120+
# Now safe
121+
kubectl wait --for=condition=Available deployment -n operators --all --timeout=180s
122+
123+
echo "Extracting cluster URL..."
124+
echo "CLUSTER_URL=$(kubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}')" >> $GITHUB_ENV
125+
82126
# UI tests fail under linux
83127
# Run UI tests
84128
- name: Run UI Tests

0 commit comments

Comments
 (0)