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/04/02 01:30:12 UTC

[GitHub] [apisix] tokers commented on a change in pull request #6779: feat(request-id): add algorithm support nanoid

tokers commented on a change in pull request #6779:
URL: https://github.com/apache/apisix/pull/6779#discussion_r840989086



##########
File path: t/plugin/request-id.t
##########
@@ -646,3 +646,36 @@ GET /opentracing
 X-Request-ID: 123
 --- response_headers
 X-Request-ID: 123
+
+
+
+=== TEST 20: add plugin with algorithm nanoid (default uuid)
+--- config
+    location /t {
+        content_by_lua_block {
+            local t = require("lib.test_admin").test
+            local code, body = t('/apisix/admin/routes/1',
+                 ngx.HTTP_PUT,
+                 [[{
+                        "plugins": {
+                            "request-id": {
+                                "algorithm": "nanoid"
+                            }
+                        },
+                        "upstream": {
+                            "nodes": {
+                                "127.0.0.1:1982": 1
+                            },
+                            "type": "roundrobin"
+                        },
+                        "uri": "/opentracing"
+                }]]
+                )
+            if code >= 300 then
+                ngx.status = code
+            end
+            ngx.say(body)
+        }
+    }
+--- response_body
+passed

Review comment:
       Should add another case to cover the id generation.




-- 
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