upstream-hash-by annotation support for dynamic configuraton mode
This commit is contained in:
parent
0813b38314
commit
2ce9196ecf
7 changed files with 174 additions and 3 deletions
6
rootfs/etc/nginx/lua/test/balancer/chash_test.lua
Normal file
6
rootfs/etc/nginx/lua/test/balancer/chash_test.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
local cwd = io.popen("pwd"):read('*l')
|
||||
package.path = cwd .. "/rootfs/etc/nginx/lua/?.lua;" .. package.path
|
||||
|
||||
describe("[chash_test]", function()
|
||||
-- TODO(elvinefendi) add unit tests
|
||||
end)
|
||||
|
|
@ -49,6 +49,7 @@ local function init()
|
|||
mock_sticky = {}
|
||||
mock_ngx_balancer = {}
|
||||
mock_ewma = {}
|
||||
mock_chash = {}
|
||||
mock_backends = dict_generator(default_backends)
|
||||
mock_lrucache = {
|
||||
new = function () return mock_backends end
|
||||
|
|
@ -78,6 +79,7 @@ local function init()
|
|||
package.loaded["cjson"] = mock_cjson
|
||||
package.loaded["resty.lock"] = mock_lock
|
||||
package.loaded["balancer.ewma"] = mock_ewma
|
||||
package.loaded["balancer.chash"] = mock_chash
|
||||
package.loaded["configuration"] = mock_config
|
||||
package.loaded["sticky"] = mock_sticky
|
||||
balancer = require("balancer")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue