Skip to content

Commit

Permalink
Revert "add page rows number"
Browse files Browse the repository at this point in the history
This reverts commit 24521c4.
  • Loading branch information
chronolaw committed Nov 27, 2024
1 parent b4e5c18 commit a3a40ba
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 29 deletions.
21 changes: 0 additions & 21 deletions spec/02-integration/11-dbless/04-pagination_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,16 @@ local SERVICE_YML = [[


describe("dbless pagination #off", function()
local client

lazy_setup(function()
assert(helpers.start_kong({
nginx_conf = "spec/fixtures/custom_nginx.template",
database = "off",
plugins = "bundled,dbless-pagination-test",
}))
print("helpers.start_kong")

client = assert(helpers.proxy_client())
end)

lazy_teardown(function()
client:close()
helpers.stop_kong()
end)

Expand All @@ -50,21 +45,5 @@ describe("dbless pagination #off", function()
assert.res_status(201, res)
admin_client:close()

local res = admin_client:get("/routes/my-route-1")
print(res:read_body())
print("-------")

-- check routes number with :page() API
--local res, err = client:get("/1", {})

local res = assert(client:send {
method = "GET",
path = "/1",
})
--print(require("inspect")(res))
local resbody = res:read_body()
print"--------"
print(resbody)
--assert.response(res).has.header("X-rows-number", "test")
end)
end)
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,5 @@ function LmdbPaginationTestHandler:init_worker()
ngx.timer.at(0, test)
end

function LmdbPaginationTestHandler:access(conf)
ngx.log(ngx.INFO, "xxxxxxxxxxxxxx")
local rows, err, err_t, offset = kong.db.routes:page()

ngx.header["X-rows-number"] = #rows
end


return LmdbPaginationTestHandler
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
return {
name = "dbless-pagination-test",
name = "dns-client-test",
fields = {
{
config = {
Expand Down

0 comments on commit a3a40ba

Please sign in to comment.