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

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


The following commit(s) were added to refs/heads/master by this push:
     new 95af20a  refactor: plugins list test representation (#5642)
95af20a is described below

commit 95af20ac73d3dbd433157e99a462a18529033fb4
Author: Bisakh <[email protected]>
AuthorDate: Tue Nov 30 09:25:56 2021 +0530

    refactor: plugins list test representation (#5642)
---
 t/admin/plugins.t | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 76 insertions(+), 3 deletions(-)

diff --git a/t/admin/plugins.t b/t/admin/plugins.t
index f20b8b9..4305b66 100644
--- a/t/admin/plugins.t
+++ b/t/admin/plugins.t
@@ -38,9 +38,82 @@ __DATA__
 
 === TEST 1: get plugins' name
 --- request
-GET /apisix/admin/plugins/list
---- response_body_like eval
-qr/\["real-ip","client-control","ext-plugin-pre-req","zipkin","request-id","fault-injection","serverless-pre-function","batch-requests","cors","ip-restriction","ua-restriction","referer-restriction","uri-blocker","request-validation","openid-connect","authz-casbin","wolf-rbac","ldap-auth","hmac-auth","basic-auth","jwt-auth","key-auth","consumer-restriction","authz-keycloak","proxy-mirror","proxy-cache","proxy-rewrite","api-breaker","limit-conn","limit-count","limit-req","gzip","server-in
 [...]
+--- config
+    location /t {
+        content_by_lua_block {
+            local t = require("lib.test_admin").test
+            local json = require('cjson')
+            local code, _, body = t("/apisix/admin/plugins/list", "GET")
+             if code >= 300 then
+                ngx.status = code
+                ngx.say(body)
+                return
+            end
+
+            local tab = json.decode(body)
+            for _, v in ipairs(tab) do
+                ngx.say(v)
+            end
+        }
+    }
+--- request
+GET /t
+
+--- response_body
+real-ip
+client-control
+ext-plugin-pre-req
+zipkin
+request-id
+fault-injection
+serverless-pre-function
+batch-requests
+cors
+ip-restriction
+ua-restriction
+referer-restriction
+uri-blocker
+request-validation
+openid-connect
+authz-casbin
+wolf-rbac
+ldap-auth
+hmac-auth
+basic-auth
+jwt-auth
+key-auth
+consumer-restriction
+authz-keycloak
+proxy-mirror
+proxy-cache
+proxy-rewrite
+api-breaker
+limit-conn
+limit-count
+limit-req
+gzip
+server-info
+traffic-split
+redirect
+response-rewrite
+grpc-transcode
+prometheus
+datadog
+echo
+http-logger
+skywalking-logger
+google-cloud-logging
+sls-logger
+tcp-logger
+kafka-logger
+syslog
+udp-logger
+example-plugin
+azure-functions
+openwhisk
+serverless-post-function
+ext-plugin-post-req
+
 --- no_error_log
 [error]
 

Reply via email to