This is an automated email from the ASF dual-hosted git repository. membphis 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 8493a60 test: also lint the test helpers (#2252) 8493a60 is described below commit 8493a607ce869ab335eac1d0e799ffecff10fb93 Author: 罗泽轩 <spacewander...@gmail.com> AuthorDate: Sat Sep 19 19:07:39 2020 +0800 test: also lint the test helpers (#2252) Close #2215 --- t/lib/server.lua | 13 +++++++++---- t/lib/test_admin.lua | 1 + utils/check-lua-code-style.sh | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/t/lib/server.lua b/t/lib/server.lua index 68ba81a..c9e89e9 100644 --- a/t/lib/server.lua +++ b/t/lib/server.lua @@ -154,7 +154,8 @@ function _M.mock_zipkin() ngx.exit(400) end - if span.localEndpoint.serviceName ~= 'APISIX' and span.localEndpoint.serviceName ~= 'apisix' then + if span.localEndpoint.serviceName ~= 'APISIX' + and span.localEndpoint.serviceName ~= 'apisix' then ngx.exit(400) end @@ -205,7 +206,9 @@ function _M.wolf_rbac_access_check() local args = ngx.req.get_uri_args() local resName = args.resName if resName == '/hello' or resName == '/wolf/rbac/custom/headers' then - ngx.say(json_encode({ok=true, data={ userInfo={nickname="administrator",username="admin", id="100"} }})) + ngx.say(json_encode({ok=true, + data={ userInfo={nickname="administrator", + username="admin", id="100"} }})) else ngx.status = 401 ngx.say(json_encode({ok=false, reason="no permission to access"})) @@ -220,7 +223,8 @@ function _M.wolf_rbac_user_info() ngx.exit(0) end - ngx.say(json_encode({ok=true, data={ userInfo={nickname="administrator", username="admin", id="100"} }})) + ngx.say(json_encode({ok=true, + data={ userInfo={nickname="administrator", username="admin", id="100"} }})) end function _M.wolf_rbac_change_pwd() @@ -237,7 +241,8 @@ end function _M.wolf_rbac_custom_headers() local headers = ngx.req.get_headers() - ngx.say('id:' .. headers['X-UserId'] .. ',username:' .. headers['X-Username'] .. ',nickname:' .. headers['X-Nickname']) + ngx.say('id:' .. headers['X-UserId'] .. ',username:' .. headers['X-Username'] + .. ',nickname:' .. headers['X-Nickname']) end function _M.websocket_handshake() diff --git a/t/lib/test_admin.lua b/t/lib/test_admin.lua index dc245c3..ac6d22e 100644 --- a/t/lib/test_admin.lua +++ b/t/lib/test_admin.lua @@ -16,6 +16,7 @@ -- local http = require("resty.http") local json = require("cjson.safe") +local core = require("apisix.core") local aes = require "resty.aes" local ngx_encode_base64 = ngx.encode_base64 local str_find = string.find diff --git a/utils/check-lua-code-style.sh b/utils/check-lua-code-style.sh index 6cb80d3..2dfff59 100755 --- a/utils/check-lua-code-style.sh +++ b/utils/check-lua-code-style.sh @@ -19,7 +19,7 @@ set -ex -luacheck -q apisix +luacheck -q apisix t/lib find apisix -name '*.lua' -exec ./utils/lj-releng {} + > \ /tmp/check.log 2>&1 || (cat /tmp/check.log && exit 1)