Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: check the clusterpedia apiserver before test cases #705

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions test/environments/multiple.env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,9 @@ done

"${ROOT}/hack/gen-clusterconfigs.sh"

if ! check_clusterpedia_apiserver; then
echo "clusterpedia apiserver is not ready"
exit 1
fi

"${cases}"
5 changes: 5 additions & 0 deletions test/environments/single.env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,9 @@ create_data_plane ${data_plane_name} ${version} || {

"${ROOT}/hack/gen-clusterconfigs.sh"

if ! check_clusterpedia_apiserver; then
echo "clusterpedia apiserver is not ready"
exit 1
fi

"${cases}"
12 changes: 12 additions & 0 deletions test/helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,15 @@ function delete_data_plane() {
kwokctl export logs --name "${name}" "${ROOT}/test/logs/kwok/${name}"
kwokctl delete cluster --name "${name}"
}

# check if the apiserver in the control plane is ready
function check_clusterpedia_apiserver() {
for i in {1..3}
do
if kubectl get --raw="/apis/clusterpedia.io/v1beta1/">/dev/null; then # only print error messages of the kubectl
return 0
fi
sleep 10
done
return 1
}
Loading