Skip to content

Commit

Permalink
check log file
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Nov 9, 2024
1 parent cd86e1c commit c6c22a4
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions spec/02-integration/19-incrmental_sync/01-sync_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ describe("Incremental Sync RPC #" .. strategy, function()
return true
end
end, 10)

assert.logfile().has.line("[kong.sync.v2] config push (connected client)", true)
assert.logfile().has.no.line("unable to update clustering data plane status", true)

assert.logfile("servroot2/logs/error.log").has.line("[kong.sync.v2] update entity", true)
end)

it("update route on CP", function()
Expand Down Expand Up @@ -133,6 +138,11 @@ describe("Incremental Sync RPC #" .. strategy, function()
return true
end
end, 10)

assert.logfile().has.line("[kong.sync.v2] config push (connected client)", true)
assert.logfile().has.no.line("unable to update clustering data plane status", true)

assert.logfile("servroot2/logs/error.log").has.line("[kong.sync.v2] update entity", true)
end)

it("delete route on CP", function()
Expand Down Expand Up @@ -170,6 +180,11 @@ describe("Incremental Sync RPC #" .. strategy, function()
end
end, 10)

assert.logfile().has.line("[kong.sync.v2] config push (connected client)", true)
assert.logfile().has.no.line("unable to update clustering data plane status", true)

assert.logfile("servroot2/logs/error.log").has.line("[kong.sync.v2] update entity", true)

res = assert(admin_client:delete("/services/service-003/routes/" .. route_id))
assert.res_status(204, res)

Expand All @@ -187,6 +202,8 @@ describe("Incremental Sync RPC #" .. strategy, function()
return true
end
end, 10)

assert.logfile("servroot2/logs/error.log").has.line("[kong.sync.v2] delete entity", true)
end)

it("update route on CP with name", function()
Expand Down Expand Up @@ -243,6 +260,11 @@ describe("Incremental Sync RPC #" .. strategy, function()
return true
end
end, 10)

assert.logfile().has.line("[kong.sync.v2] config push (connected client)", true)
assert.logfile().has.no.line("unable to update clustering data plane status", true)

assert.logfile("servroot2/logs/error.log").has.line("[kong.sync.v2] update entity", true)
end)

it("delete route on CP with name", function()
Expand Down Expand Up @@ -279,6 +301,11 @@ describe("Incremental Sync RPC #" .. strategy, function()
end
end, 10)

assert.logfile().has.line("[kong.sync.v2] config push (connected client)", true)
assert.logfile().has.no.line("unable to update clustering data plane status", true)

assert.logfile("servroot2/logs/error.log").has.line("[kong.sync.v2] update entity", true)

res = assert(admin_client:delete("/services/service-005/routes/route-005"))
assert.res_status(204, res)

Expand All @@ -296,6 +323,8 @@ describe("Incremental Sync RPC #" .. strategy, function()
return true
end
end, 10)

assert.logfile("servroot2/logs/error.log").has.line("[kong.sync.v2] delete entity", true)
end)

it("cascade delete on CP", function()
Expand Down Expand Up @@ -335,6 +364,11 @@ describe("Incremental Sync RPC #" .. strategy, function()
end
end, 10)

assert.logfile().has.line("[kong.sync.v2] config push (connected client)", true)
assert.logfile().has.no.line("unable to update clustering data plane status", true)

assert.logfile("servroot2/logs/error.log").has.line("[kong.sync.v2] update entity", true)

-- create consumer and key-auth

res = assert(admin_client:post("/consumers", {
Expand Down Expand Up @@ -393,6 +427,9 @@ describe("Incremental Sync RPC #" .. strategy, function()
return true
end
end, 10)

assert.logfile().has.line("[kong.sync.v2] new delta due to cascade deleting", true)
assert.logfile("servroot2/logs/error.log").has.line("[kong.sync.v2] delete entity", true)
end)
end)

Expand Down

0 comments on commit c6c22a4

Please sign in to comment.