Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: exported schema for plugin serverless. #787

Merged
merged 1 commit into from
Nov 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lua/apisix/plugins/serverless.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ return function(plugin_name, priority)
version = 0.1,
priority = priority,
name = plugin_name,
schema = schema,
}

local function load_funcs(functions)
Expand Down
80 changes: 80 additions & 0 deletions t/admin/schema.t
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,83 @@ GET /apisix/admin/schema/plugins/no-exist
--- error_code: 400
--- no_error_log
[error]



=== TEST 9: serverless-pre-function
--- config
location /t {
content_by_lua_block {
local t = require("lib.test_admin").test
local code, body = t('/apisix/admin/schema/plugins/serverless-pre-function',
ngx.HTTP_GET,
nil,
[[{
"properties": {
"phase": {
"enum": ["rewrite", "access", "header_filer", "body_filter", "log", "balancer"],
"type": "string"
},
"functions": {
"minItems": 1,
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["functions"],
"type": "object"
}]]
)

ngx.status = code
ngx.say(body)
}
}
--- request
GET /t
--- response_body
passed
--- no_error_log
[error]



=== TEST 10: serverless-post-function
--- config
location /t {
content_by_lua_block {
local t = require("lib.test_admin").test
local code, body = t('/apisix/admin/schema/plugins/serverless-post-function',
ngx.HTTP_GET,
nil,
[[{
"properties": {
"phase": {
"enum": ["rewrite", "access", "header_filer", "body_filter", "log", "balancer"],
"type": "string"
},
"functions": {
"minItems": 1,
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["functions"],
"type": "object"
}]]
)

ngx.status = code
ngx.say(body)
}
}
--- request
GET /t
--- response_body
passed
--- no_error_log
[error]
1 change: 1 addition & 0 deletions t/config-center-yaml/route-upstream.t
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ GET /hello
failed to find upstream by id: 1111



=== TEST 3: upstream_id priority upstream
--- yaml_config eval: $::yaml_config
--- apisix_yaml
Expand Down