tzssangglass commented on code in PR #8205:
URL: https://github.com/apache/apisix/pull/8205#discussion_r1014947771


##########
t/plugin/google-cloud-logging.t:
##########
@@ -745,9 +801,137 @@ passed
 
 
 
-=== TEST 25: test route(https file configuration SSL authentication succeed: 
ssl_verify = false)
+=== TEST 25: test route (https file configuration SSL authentication succeed: 
ssl_verify = false)
 --- request
 GET /hello
 --- wait: 2
 --- response_body
 hello world
+
+
+
+=== TEST 26: set include_req_body = true on route succeeds
+--- config
+    location /t {
+        content_by_lua_block {
+
+            local config = {
+                uri = "/hello",
+                upstream = {
+                    type = "roundrobin",
+                    nodes = {
+                        ["127.0.0.1:1980"] = 1
+                    }
+                },
+                plugins = {
+                    ["google-cloud-logging"] = {
+                        auth_file = 
"t/plugin/google-cloud-logging/config-https-ip.json",
+                        inactive_timeout = 1,
+                        batch_max_size = 1,
+                        ssl_verify = false,
+                        include_req_body = true,
+                    }
+                }
+            }
+            local t = require("lib.test_admin").test
+            local code, body = t('/apisix/admin/routes/1', ngx.HTTP_PUT, 
config)
+
+            if code >= 300 then
+                ngx.status = code
+                ngx.say(body)
+                return
+            end
+
+            ngx.say(body)
+        }
+    }
+--- response_body
+passed
+
+
+
+=== TEST 27: set fetch request body and response body route
+--- config
+    location /t {
+        content_by_lua_block {
+            local config = {
+                uri = "/google-cloud-logging/test",
+                method = 'POST',
+                upstream = {
+                    type = "roundrobin",
+                    nodes = {
+                        ["127.0.0.1:12001"] = 1
+                    }
+                },
+                plugins = {
+                    ["google-cloud-logging"] = {
+                        auth_file = 
"t/plugin/google-cloud-logging/config.json",
+                        inactive_timeout = 1,
+                        batch_max_size = 1,
+                        include_req_body = true,
+                    }
+                }
+            }
+            local t = require("lib.test_admin").test
+            local code, body = t('/apisix/admin/routes/1', ngx.HTTP_PUT, 
config)
+
+            if code >= 300 then
+                ngx.status = code
+                ngx.say(body)
+                return
+            end
+
+            ngx.say(body)
+        }
+    }
+--- response_body
+passed

Review Comment:
   It appears that TEST 28 and 29 is a duplicate of TEST 26 and 27. As long as 
TEST 28 and 29 run successfully, it can be verified, right?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to