Skip to content

Commit

Permalink
fix e2e not stable
Browse files Browse the repository at this point in the history
Signed-off-by: DangPeng Liu <[email protected]>
  • Loading branch information
ldpliu committed Mar 5, 2025
1 parent 74b418c commit 7630b00
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
3 changes: 2 additions & 1 deletion test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ e2e-cleanup:

e2e-test-all: tidy vendor
sh ./test/script/e2e_run.sh -f "e2e-test-localpolicy,e2e-test-placement,e2e-test-app,e2e-test-policy,e2e-tests-backup,e2e-test-grafana,e2e-test-agent" -v $(VERBOSE)
sh ./test/script/e2e_run_qe.sh
sh ./test/script/e2e_run.sh -f "e2e-test-prune" -v $(VERBOSE)
sh ./test/script/e2e_clean_globalhub.sh
sh ./test/script/e2e_run_qe.sh
sh ./test/script/e2e_clean_globalhub.sh
sh ./test/script/e2e_run_byo.sh -v $(VERBOSE)

e2e-test-cluster e2e-test-placement e2e-test-app e2e-test-policy e2e-test-localpolicy e2e-test-grafana e2e-test-agent: tidy vendor
Expand Down
10 changes: 3 additions & 7 deletions test/script/e2e_clean_globalhub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ echo "Delete mgh"
wait_cmd "kubectl delete multiclusterglobalhubs --all -n $GH_NAMESPACE --ignore-not-found=true"

export TARGET_NAMESPACE=$GH_NAMESPACE
cd operator
make undeploy

cd $CURRENT_DIR

kubectl delete clusterrolebinding multicluster-global-hub-operator-rolebinding --ignore-not-found=true
kubectl delete clusterrolebinding multicluster-global-hub-operator-aggregated-clusterrolebinding --ignore-not-found=true

## wait kafka/kafkatopic/kafka user be deleted
echo "Check kafkatopics deleted"
Expand All @@ -62,6 +55,9 @@ if [[ ! -z $(kubectl get kafka -n "$GH_NAMESPACE" --ignore-not-found=true) ]]; t
exit 1
fi

cd operator
make undeploy

## clean
wait_cmd "kubectl delete crd kafkas.kafka.strimzi.io --ignore-not-found=true"
wait_cmd "kubectl delete crd kafkanodepools.kafka.strimzi.io --ignore-not-found=true"
Expand Down
28 changes: 28 additions & 0 deletions test/script/e2e_run_qe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,35 @@ source "$CURRENT_DIR/util.sh"
CONFIG_DIR=$CURRENT_DIR/config
GH_KUBECONFIG="${CONFIG_DIR}/global-hub"
MH1_KUBECONFIG="${CONFIG_DIR}/hub1"
export KUBECONFIG=$GH_KUBECONFIG

##Install globalhub
cd $CURRENT_DIR/../../operator
make deploy
cat <<EOF | kubectl apply --kubeconfig $GH_KUBECONFIG -f -
apiVersion: operator.open-cluster-management.io/v1alpha4
kind: MulticlusterGlobalHub
metadata:
name: multiclusterglobalhub
namespace: multicluster-global-hub
annotations:
mgh-skip-auth: "true"
mgh-scheduler-interval: "minute"
global-hub.open-cluster-management.io/catalog-source-name: "operatorhubio-catalog"
global-hub.open-cluster-management.io/catalog-source-namespace: "olm"
global-hub.open-cluster-management.io/kafka-use-nodeport: ""
global-hub.open-cluster-management.io/kind-cluster-ip: os.Getenv("GLOBAL_HUB_NODE_IP")
spec:
availabilityConfig: Basic
enableMetrics: false
dataLayer:
postgres:
retention: 18m
EOF

wait_cmd "kubectl get mgh --kubeconfig $GH_KUBECONFIG -n multicluster-global-hub | grep Running"

cd $CONFIG_DIR
docker pull quay.io/hchenxa/acmqe-hoh-e2e
docker run --name qe-test -d quay.io/hchenxa/acmqe-hoh-e2e tail -f /dev/null
docker cp qe-test:/e2e.test ./
Expand Down

0 comments on commit 7630b00

Please sign in to comment.