Просмотр исходного кода

fix: update integration testcases for relup

Shawn 3 лет назад
Родитель
Сommit
08207c086c
2 измененных файлов с 48 добавлено и 3 удалено
  1. 47 3
      .ci/fvt_tests/relup.lux
  2. 1 0
      .github/workflows/run_relup_tests.yaml

+ 47 - 3
.ci/fvt_tests/relup.lux

@@ -85,6 +85,27 @@
 
 
     !cp -f ../$PROFILE-$VSN-*-ubuntu20.04-amd64.tar.gz releases/
     !cp -f ../$PROFILE-$VSN-*-ubuntu20.04-amd64.tar.gz releases/
 
 
+    ## 1. upgrade to the new version
+    !./bin/emqx install $VSN
+    ?Made release permanent: "$VSN"
+    ?SH-PROMPT
+
+    !./bin/emqx versions |grep permanent
+    ?(.*)$VSN
+    ?SH-PROMPT
+
+    ## 2. downgrade to the old version
+    !./bin/emqx install $old_vsn
+    ?Made release permanent:.*
+    ?SH-PROMPT
+
+    !./bin/emqx versions |grep permanent | grep -qs "$old_vsn"
+    ?SH-PROMPT:
+    !echo ==$$?==
+    ?^==0==
+    ?SH-PROMPT:
+
+    ## 3. again, upgrade to the new version
     !./bin/emqx install $VSN
     !./bin/emqx install $VSN
     ?Made release permanent: "$VSN"
     ?Made release permanent: "$VSN"
     ?SH-PROMPT
     ?SH-PROMPT
@@ -110,6 +131,27 @@
 
 
     !cp -f ../$PROFILE-$VSN-*-ubuntu20.04-amd64.tar.gz releases/
     !cp -f ../$PROFILE-$VSN-*-ubuntu20.04-amd64.tar.gz releases/
 
 
+    ## 1. upgrade to the new version
+    !./bin/emqx install $VSN
+    ?Made release permanent: "$VSN"
+    ?SH-PROMPT
+
+    !./bin/emqx versions |grep permanent
+    ?(.*)$VSN
+    ?SH-PROMPT
+
+    ## 2. downgrade to the old version
+    !./bin/emqx install $old_vsn
+    ?Made release permanent:.*
+    ?SH-PROMPT
+
+    !./bin/emqx versions |grep permanent | grep -qs "$old_vsn"
+    ?SH-PROMPT:
+    !echo ==$$?==
+    ?^==0==
+    ?SH-PROMPT:
+
+    ## 3. again, upgrade to the new version
     !./bin/emqx install $VSN
     !./bin/emqx install $VSN
     ?Made release permanent: "$VSN"
     ?Made release permanent: "$VSN"
     ?SH-PROMPT
     ?SH-PROMPT
@@ -129,18 +171,20 @@
     ?Plugin\(emqx_management.*active=true\)
     ?Plugin\(emqx_management.*active=true\)
     ?SH-PROMPT
     ?SH-PROMPT
 
 
+## We don't guarantee not to lose a single message!
+## So even if we received 290~300 messages, we consider it as success
 [shell bench]
 [shell bench]
     ???publish complete
     ???publish complete
     ??SH-PROMPT:
     ??SH-PROMPT:
     !sleep 5
     !sleep 5
     ?SH-PROMPT
     ?SH-PROMPT
 
 
-    !curl --user admin:public --silent --show-error http://localhost:8081/api/v4/rules | jq --raw-output ".data[0].metrics[] | select(.node==\"emqx@127.0.0.1\").matched"
+    !curl --user admin:public --silent --show-error http://localhost:18083/api/v5/rules | jq --raw-output ".[0].node_metrics[] | select(.node==\"emqx@127.0.0.1\") | .metrics.matched"
     ?300
     ?300
     ?SH-PROMPT
     ?SH-PROMPT
 
 
-    !curl http://127.0.0.1:8080/counter
-    ???{"data":300,"code":0}
+    !curl --user admin:public --silent --show-error http://localhost:18083/api/v5/rules | jq --raw-output ".[0].node_metrics[] | select(.node==\"emqx@127.0.0.1\") | .metrics.\"actions.success\""
+    ?\{"data":(29[0-9])|(300),"code":0\}
     ?SH-PROMPT
     ?SH-PROMPT
 
 
 [shell emqx2]
 [shell emqx2]

+ 1 - 0
.github/workflows/run_relup_tests.yaml

@@ -71,6 +71,7 @@ jobs:
 
 
     - name: Get old vsn
     - name: Get old vsn
       run: echo "OLD_VSNS=$(emqx/scripts/relup-base-vsns.sh ${{ matrix.profile }} | xargs echo -n)" >> $GITHUB_ENV
       run: echo "OLD_VSNS=$(emqx/scripts/relup-base-vsns.sh ${{ matrix.profile }} | xargs echo -n)" >> $GITHUB_ENV
+      run: echo "VSN=$(emqx/pkg-vsn.sh ${{ matrix.profile }})" >> $GITHUB_ENV
 
 
     - name: build emqx
     - name: build emqx
       env:
       env: