spacewander commented on a change in pull request #5646:
URL: https://github.com/apache/apisix/pull/5646#discussion_r759061547
##########
File path: t/plugin/google-cloud-logging.t
##########
@@ -509,3 +509,99 @@ qr/\{\"error\"\:\"[\w+\s+]*\"\}/
--- error_log
Batch Processor[google-cloud-logging] failed to process entries
Batch Processor[google-cloud-logging] exceeded the max_retry_count
+
+
+
+=== TEST 16: set route (succeed write)
+--- 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-configuration.json",
+ inactive_timeout = 1,
+ batch_max_size = 1,
+ }
+ }
+ }
+ 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 17: test route(succeed write)
+--- request
+GET /hello
+--- wait: 2
+--- response_body
+hello world
+
+
+
+=== TEST 18: set route (succeed write)
Review comment:
The route is not for a successful case?
##########
File path: t/plugin/google-cloud-logging-configuration.json
##########
@@ -0,0 +1,9 @@
+{
+ "private_key": "-----BEGIN RSA PRIVATE
KEY-----\nMIIBOgIBAAJBAKebDxlvQMGyEesAL1r1nIJBkSdqu3Hr7noq/0ukiZqVQLSJPMOv\n0oxQSutvvK3hoibwGakDOza+xRITB7cs2cECAwEAAQJAYPWh6YvjwWobVYC45Hz7\n+pqlt1DWeVQMlN407HSWKjdH548ady46xiQuZ5Cfx3YyCcnsfVWaQNbC+jFbY4YL\nwQIhANfASwz8+2sKg1xtvzyaChX5S5XaQTB+azFImBJumixZAiEAxt93Td6JH1RF\nIeQmD/K+DClZMqSrliUzUqJnCPCzy6kCIAekDsRh/UF4ONjAJkKuLedDUfL3rNFb\n2M4BBSm58wnZAiEAwYLMOg8h6kQ7iMDRcI9I8diCHM8yz0SfbfbsvzxIFxECICXs\nYvIufaZvBa8f+E/9CANlVhm5wKAyM8N8GJsiCyEG\n-----END
RSA PRIVATE KEY-----",
Review comment:
Let's put it under `t/plugin/google-cloud-logging`
--
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]