You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/01/21 02:43:48 UTC

[GitHub] [apisix] spacewander commented on a change in pull request #6155: fix(admin): correct the count field of plugin-metadata/global-rule

spacewander commented on a change in pull request #6155:
URL: https://github.com/apache/apisix/pull/6155#discussion_r789305898



##########
File path: t/admin/global-rules2.t
##########
@@ -61,3 +61,91 @@ __DATA__
     }
 --- response_body
 {"action":"get","count":0,"node":{"dir":true,"key":"/apisix/global_rules","nodes":{}}}
+
+
+
+=== TEST 2: set global rule
+--- config
+    location /t {
+        content_by_lua_block {
+            local json = require("toolkit.json")
+            local t = require("lib.test_admin").test
+            local code, message, res = t('/apisix/admin/global_rules/1',
+                 ngx.HTTP_PUT,
+                [[{
+                    "plugins": {
+                        "proxy-rewrite": {
+                            "uri": "/"
+                        }
+                    }
+                }]]
+                )
+
+            if code >= 300 then
+                ngx.status = code
+                ngx.say(message)
+                return
+            end
+
+            res = json.decode(res)
+            res.node.value.create_time = nil
+            res.node.value.update_time = nil
+            ngx.say(json.encode(res))
+        }
+    }
+--- response_body
+{"action":"set","node":{"key":"/apisix/global_rules/1","value":{"id":"1","plugins":{"proxy-rewrite":{"uri":"/"}}}}}
+--- request

Review comment:
       But you already set them (--- request,  --- no_error_log) in https://github.com/apache/apisix/pull/6155/files#diff-150a3eabdca95c99b2f057a9981111fd3dc0f7c830999549b60ce791265319c3R28




-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org