Skip to content

Commit 9343dc0

Browse files
committed
add artifacts and sync check
1 parent d494c0e commit 9343dc0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.github/workflows/e2e.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ jobs:
7878
working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }}
7979
- name: multicluster tests
8080
run: |
81+
mkdir ${ARTIFACTS_DIR}
8182
kubectl get pods -A --kubeconfig $KUBECONFIG1
8283
helm install --namespace=cluster-registry --create-namespace cluster-registry-controller deploy/charts/cluster-registry --set localCluster.name=c1 --set image.repository=cluster-registry-controller --set image.tag=ci-test --kubeconfig $KUBECONFIG1
8384
kubectl get pods -A --kubeconfig $KUBECONFIG1
@@ -100,7 +101,24 @@ jobs:
100101
kubectl get secret -n cluster-registry c2 --kubeconfig $KUBECONFIG2 -o yaml | kubectl apply --kubeconfig $KUBECONFIG1 -f -
101102
kubectl get clusters -o yaml --kubeconfig $KUBECONFIG1
102103
kubectl get clusters -o yaml --kubeconfig $KUBECONFIG2
104+
kubectl get clusters -o yaml --kubeconfig $KUBECONFIG1 > ${ARTIFACTS_DIR}/clusters_c1.yaml
105+
kubectl get clusters -o yaml --kubeconfig $KUBECONFIG2 > ${ARTIFACTS_DIR}/clusters_c2.yaml
106+
sync1=$(kubectl get clusters -A --kubeconfig $KUBECONFIG1 -o jsonpath='{range .items[*]}{@.status.conditions[?(@.type=="ClustersSynced")].status}{end}')
107+
sync2=$(kubectl get clusters -A --kubeconfig $KUBECONFIG2 -o jsonpath='{range .items[*]}{@.status.conditions[?(@.type=="ClustersSynced")].status}{end}')
108+
if [[ "$sync1" == "" || "$sync2" == "" ]]; then
109+
echo "one or more clusters not in sync"
110+
exit 1
111+
fi
103112
working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }}
113+
env:
114+
ARTIFACTS_DIR: ${{ github.workspace }}/test_artifacts
104115
- name: Cleanup resources
105116
if: ${{ success() || failure() || cancelled() }}
106117
run: kind delete clusters $(kind get clusters)
118+
- name: Upload artifacts
119+
if: ${{ success() || failure() || cancelled() }}
120+
uses: actions/upload-artifact@v3
121+
with:
122+
name: test_artifacts
123+
path: ${{ github.workspace }}/test_artifacts
124+

0 commit comments

Comments
 (0)