This is an automated email from the ASF dual-hosted git repository.

gongchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git


The following commit(s) were added to refs/heads/master by this push:
     new a71c61a0d [fix] the e2e failure without broken the ci (#2093)
a71c61a0d is described below

commit a71c61a0d8f4de827930360edfbd758bb8b5c89f
Author: Rick <[email protected]>
AuthorDate: Wed Jun 19 00:07:35 2024 +0800

    [fix] the e2e failure without broken the ci (#2093)
    
    Co-authored-by: rick <[email protected]>
---
 e2e/data/monitor-http.json | 167 ++++++++++++++++++++++++---------------------
 e2e/start.sh               |  24 +------
 e2e/testsuite.yaml         |  17 ++---
 3 files changed, 97 insertions(+), 111 deletions(-)

diff --git a/e2e/data/monitor-http.json b/e2e/data/monitor-http.json
index 06fd46b9a..841610abc 100644
--- a/e2e/data/monitor-http.json
+++ b/e2e/data/monitor-http.json
@@ -1,80 +1,93 @@
-
 {
-    "detected": false,
-    "collector": "",
-    "monitor": {
-      "intervals": 60,
-      "tags": [],
-      "app": "api",
-      "host": "127.0.0.1",
+  "detected": false,
+  "collector": "",
+  "monitor": {
+    "intervals": 60,
+    "tags": [],
+    "app": "api",
+    "host": "127.0.0.1",
       "name": "{{.param.monitorHTTP}}"
+  },
+  "params": [
+    {
+      "display": true,
+      "field": "host",
+      "type": 1,
+      "paramValue": "127.0.0.1"
     },
-    "params": [
-      {
-        "field": "host",
-        "type": 1,
-        "value": "127.0.0.1"
-      },
-      {
-        "field": "port",
-        "type": 0,
-        "value": 80
-      },
-      {
-        "field": "method",
-        "type": 1,
-        "value": "GET"
-      },
-      {
-        "field": "uri",
-        "type": 1,
-        "value": ""
-      },
-      {
-        "field": "ssl",
-        "type": 1,
-        "value": false
-      },
-      {
-        "field": "headers",
-        "type": 3
-      },
-      {
-        "field": "params",
-        "type": 3
-      },
-      {
-        "field": "timeout",
-        "type": 0
-      },
-      {
-        "field": "contentType",
-        "type": 1
-      },
-      {
-        "field": "payload",
-        "type": 1
-      },
-      {
-        "field": "authType",
-        "type": 1
-      },
-      {
-        "field": "username",
-        "type": 1
-      },
-      {
-        "field": "password",
-        "type": 1
-      },
-      {
-        "field": "keyword",
-        "type": 1
-      },
-      {
-        "field": "successCode",
-        "type": 4,
-        "value": "200, 201"
-      }
-    ]
-}
+    {
+      "display": true,
+      "field": "port",
+      "type": 0,
+      "paramValue": 80
+    },
+    {
+      "display": true,
+      "field": "httpMethod",
+      "type": 1,
+      "paramValue": "GET"
+    },
+    {
+      "display": true,
+      "field": "uri",
+      "type": 1
+    },
+    {
+      "display": true,
+      "field": "ssl",
+      "type": 1,
+      "paramValue": false
+    },
+    {
+      "display": true,
+      "field": "headers",
+      "type": 3
+    },
+    {
+      "display": true,
+      "field": "params",
+      "type": 3
+    },
+    {
+      "display": true,
+      "field": "timeout",
+      "type": 0
+    },
+    {
+      "display": true,
+      "field": "contentType",
+      "type": 1
+    },
+    {
+      "display": false,
+      "field": "payload",
+      "type": 1
+    },
+    {
+      "display": true,
+      "field": "authType",
+      "type": 1
+    },
+    {
+      "display": true,
+      "field": "username",
+      "type": 1
+    },
+    {
+      "display": true,
+      "field": "password",
+      "type": 1
+    },
+    {
+      "display": true,
+      "field": "keyword",
+      "type": 1
+    },
+    {
+      "display": true,
+      "field": "successCode",
+      "type": 4,
+      "paramValue": "200, 201"
+    }
+  ]
+}
\ No newline at end of file
diff --git a/e2e/start.sh b/e2e/start.sh
index 52a23b982..cb7247339 100755
--- a/e2e/start.sh
+++ b/e2e/start.sh
@@ -25,25 +25,5 @@ then
 fi
 
 docker-compose version
-docker-compose -f "$file" up --build -d
-
-while true
-do
-    docker-compose -f "$file" ps | grep testing
-    if [ $? -eq 1 ]
-    then
-        code=-1
-        docker-compose -f "$file" logs | grep e2e-testing
-        docker-compose -f "$file" logs | grep e2e-testing | grep Usage
-        if [ $? -eq 1 ]
-        then
-            code=0
-            echo "successed"
-        fi
-
-        docker-compose -f "$file" down
-        set -e
-        exit $code
-    fi
-    sleep 1
-done
+docker-compose -f "$file" down
+docker-compose -f "$file" up --build testing --exit-code-from testing 
--remove-orphans
diff --git a/e2e/testsuite.yaml b/e2e/testsuite.yaml
index 0278321b9..4435fc5f1 100644
--- a/e2e/testsuite.yaml
+++ b/e2e/testsuite.yaml
@@ -146,18 +146,15 @@ items:
       Authorization: Bearer {{.login.data.token}}
 - name: cancelHTTPMonitor
   request:
-    api: /api/monitors/manage
+    api: /api/monitors/manage?ids={{(index .listHTTPMonitor.data.content 0).id 
| int64}}
     query:
-      ids: "{{(index .listHTTPMonitor.data.content 0).id}}"
       type: JSON
     method: DELETE
     header:
       Authorization: Bearer {{.login.data.token}}
 - name: deleteHTTPMonitor
   request:
-    api: /api/monitors
-    query:
-      ids: "{{(index .listHTTPMonitor.data.content 0).id}}"
+    api: /api/monitors?ids={{(index .listHTTPMonitor.data.content 0).id | 
int64}}
     method: DELETE
     header:
       Authorization: Bearer {{.login.data.token}}
@@ -168,9 +165,7 @@ items:
       Authorization: Bearer {{.login.data.token}}
 - name: deleteAlertDefine
   request:
-    api: /api/alert/defines
-    query:
-      ids: "{{(index .listAlertDefine.data.content 0).id}}"
+    api: /api/alert/defines?ids={{(index .listAlertDefines.data.content 0).id 
| int64}}
     method: DELETE
     header:
       Authorization: Bearer {{.login.data.token}}
@@ -239,7 +234,7 @@ items:
       Content-type: application/json
     body: |
       {
-        "id": {{(index .listTags.data.content 0).id}},
+        "id": {{(index .listTags.data.content 0).id | int64}},
         "name": "{{randAlpha 3}}",
         "value": "{{randAlpha 3}}",
         "color": "#ff4081",
@@ -252,9 +247,7 @@ items:
       code: "0"
 - name: deleteTag
   request:
-    api: /api/tag
-    query:
-      ids: "{{(index .listTags.data.content 0).id}}"
+    api: /api/tag?ids={{(index .listTags.data.content 0).id | int64}}
     method: DELETE
     header:
       Authorization: Bearer {{.login.data.token}}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to