Преглед изворни кода

ci: fail faster in helm tests

Ivan Dyachkov пре 2 година
родитељ
комит
d100acf701
1 измењених фајлова са 5 додато и 12 уклоњено
  1. 5 12
      .github/workflows/run_helm_tests.yaml

+ 5 - 12
.github/workflows/run_helm_tests.yaml

@@ -99,26 +99,19 @@ jobs:
           sleep 10;
         done
     - name: Get Token
-      timeout-minutes: 1
       run: |
         kubectl port-forward service/${EMQX_NAME} 18083:18083 > /dev/null &
-
-        while
-          [ "$(curl --silent -X 'GET' 'http://127.0.0.1:18083/api/v5/status' | tail -n1)" != "emqx is running" ]
-        do
-          echo "waiting emqx"
-          sleep 1
-        done
-
+        curl --head -X GET --retry 10 --retry-connrefused --retry-delay 6 http://localhost:18083/status
         echo "TOKEN=$(curl --silent -X 'POST' 'http://127.0.0.1:18083/api/v5/login' -H 'accept: application/json' -H 'Content-Type: application/json' -d '{"username": "admin","password": "public"}' | jq -r ".token")" >> $GITHUB_ENV
 
     - name: Check cluster
-      timeout-minutes: 10
+      timeout-minutes: 1
       run: |
         while
-          [ "$(curl --silent -H "Authorization: Bearer $TOKEN" -X GET http://127.0.0.1:18083/api/v5/cluster| jq '.nodes|length')" != "3" ];
+          nodes_length="$(curl --silent -H "Authorization: Bearer $TOKEN" -X GET http://127.0.0.1:18083/api/v5/cluster| jq '.nodes|length')"
+          [ $nodes_length != "3" ]
         do
-          echo "waiting ${EMQX_NAME} cluster scale"
+          echo "waiting ${EMQX_NAME} cluster scale. Current live nodes: $nodes_length."
           sleep 1
         done
     - uses: actions/checkout@v3