Skip to content

Commit

Permalink
better than hardcode
Browse files Browse the repository at this point in the history
Signed-off-by: KfreeZ <[email protected]>
  • Loading branch information
KfreeZ committed Sep 4, 2024
1 parent 0f1e843 commit 72f2321
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/scripts/e2e/gmc_xeon_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ function validate_audioqa() {
exit 1
fi

pods_count=$(kubectl get pods -n $AUDIOQA_NAMESPACE -o jsonpath='{.items[*].metadata.name}' | wc -w)
pods_count=$(kubectl get pods -n $AUDIOQA_NAMESPACE --no-headers | grep -v "Terminating" | wc -w)
# expected_ready_pods, expected_external_pods, expected_total_pods
# pods_count-1 is to exclude the client pod in this namespace
check_gmc_status $AUDIOQA_NAMESPACE 'audioqa' 7 0 7
check_gmc_status $AUDIOQA_NAMESPACE 'audioqa' $((pods_count-1)) 0 7
if [ $? -ne 0 ]; then
echo "GMC status is not as expected"
exit 1
Expand Down Expand Up @@ -187,10 +187,10 @@ function validate_chatqna() {
exit 1
fi

pods_count=$(kubectl get pods -n $CHATQNA_NAMESPACE -o jsonpath='{.items[*].metadata.name}' | wc -w)
pods_count=$(kubectl get pods -n $CHATQNA_NAMESPACE --no-headers | grep -v "Terminating" | wc -w)
# expected_ready_pods, expected_external_pods, expected_total_pods
# pods_count-1 is to exclude the client pod in this namespace
check_gmc_status $CHATQNA_NAMESPACE 'chatqa' 9 0 9
check_gmc_status $CHATQNA_NAMESPACE 'chatqa' $((pods_count-1)) 0 9
if [ $? -ne 0 ]; then
echo "GMC status is not as expected"
exit 1
Expand Down Expand Up @@ -257,10 +257,10 @@ function validate_chatqna_with_dataprep() {
exit 1
fi

pods_count=$(kubectl get pods -n $CHATQNA_DATAPREP_NAMESPACE -o jsonpath='{.items[*].metadata.name}' | wc -w)
pods_count=$(kubectl get pods -n $CHATQNA_DATAPREP_NAMESPACE --no-headers | grep -v "Terminating" | wc -w)
# expected_ready_pods, expected_external_pods, expected_total_pods
# pods_count-1 is to exclude the client pod in this namespace
check_gmc_status $CHATQNA_DATAPREP_NAMESPACE 'chatqa' 10 0 10
check_gmc_status $CHATQNA_DATAPREP_NAMESPACE 'chatqa' $((pods_count-1)) 0 10
if [ $? -ne 0 ]; then
echo "GMC status is not as expected"
exit 1
Expand Down Expand Up @@ -350,10 +350,10 @@ function validate_chatqna_in_switch() {
exit 1
fi

pods_count=$(kubectl get pods -n $CHATQNA_SWITCH_NAMESPACE -o jsonpath='{.items[*].metadata.name}' | wc -w)
pods_count=$(kubectl get pods -n $CHATQNA_SWITCH_NAMESPACE --no-headers | grep -v "Terminating" | wc -w)
# expected_ready_pods, expected_external_pods, expected_total_pods
# pods_count-1 is to exclude the client pod in this namespace
check_gmc_status $CHATQNA_SWITCH_NAMESPACE 'switch' 15 0 15
check_gmc_status $CHATQNA_SWITCH_NAMESPACE 'switch' $((pods_count-1)) 0 15
if [ $? -ne 0 ]; then
echo "GMC status is not as expected"
exit 1
Expand Down Expand Up @@ -443,8 +443,8 @@ function validate_modify_config() {
exit 1
fi

pods_count=$(kubectl get pods -n $MODIFY_STEP_NAMESPACE -o jsonpath='{.items[*].metadata.name}' | wc -w)
check_gmc_status $MODIFY_STEP_NAMESPACE 'codegen' 3 0 3
pods_count=$(kubectl get pods -n $MODIFY_STEP_NAMESPACE --no-headers | grep -v "Terminating" | wc -w)
check_gmc_status $MODIFY_STEP_NAMESPACE 'codegen' $((pods_count-1)) 0 3
if [ $? -ne 0 ]; then
echo "GMC status is not as expected"
exit 1
Expand All @@ -461,7 +461,7 @@ function validate_modify_config() {
exit 1
fi

check_gmc_status $MODIFY_STEP_NAMESPACE 'codegen' 3 0 3
check_gmc_status $MODIFY_STEP_NAMESPACE 'codegen' $((pods_count-1)) 0 3
if [ $? -ne 0 ]; then
echo "GMC status is not as expected"
exit 1
Expand Down Expand Up @@ -494,8 +494,8 @@ function validate_remove_step() {
exit 1
fi

pods_count=$(kubectl get pods -n $DELETE_STEP_NAMESPACE -o jsonpath='{.items[*].metadata.name}' | wc -w)
check_gmc_status $DELETE_STEP_NAMESPACE 'codegen' 3 0 3
pods_count=$(kubectl get pods -n $DELETE_STEP_NAMESPACE --no-headers | grep -v "Terminating" | wc -w)
check_gmc_status $DELETE_STEP_NAMESPACE 'codegen' $((pods_count-1)) 0 3
if [ $? -ne 0 ]; then
echo "GMC status is not as expected"
exit 1
Expand Down

0 comments on commit 72f2321

Please sign in to comment.