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

tests(clustering/wasm): enable rpc sync tests for wasm partially #14256

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
24 changes: 16 additions & 8 deletions spec/02-integration/20-wasm/06-clustering_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ local function new_wasm_filter_directory()
end


-- XXX TODO: enable rpc_sync = "on"
for _, rpc_sync in ipairs { "off" } do
for _, v in ipairs({ {"off", "off"}, {"on", "off"}, {"on", "on"}, }) do
local rpc, rpc_sync = v[1], v[2]

describe("#wasm - hybrid mode #postgres" .. " rpc_sync=" .. rpc_sync, function()
local cp_prefix = "cp"
local cp_errlog = cp_prefix .. "/logs/error.log"
Expand Down Expand Up @@ -115,7 +116,8 @@ describe("#wasm - hybrid mode #postgres" .. " rpc_sync=" .. rpc_sync, function()
wasm_filters = "user", -- don't enable bundled filters for this test
wasm_filters_path = cp_filter_path,
nginx_main_worker_processes = 2,
cluster_rpc_sync = rpc_sync,
cluster_rpc = rpc,
cluster_rpc_sync = rpc_sync,
}))

assert.logfile(cp_errlog).has.line([[successfully loaded "response_transformer" module]], true, 10)
Expand Down Expand Up @@ -155,7 +157,8 @@ describe("#wasm - hybrid mode #postgres" .. " rpc_sync=" .. rpc_sync, function()
wasm_filters_path = dp_filter_path,
node_id = node_id,
nginx_main_worker_processes = 2,
cluster_rpc_sync = rpc_sync,
cluster_rpc = rpc,
cluster_rpc_sync = rpc_sync,
}))

assert.logfile(dp_errlog).has.line([[successfully loaded "response_transformer" module]], true, 10)
Expand Down Expand Up @@ -293,7 +296,10 @@ describe("#wasm - hybrid mode #postgres" .. " rpc_sync=" .. rpc_sync, function()
end)
end)

describe("data planes with wasm disabled", function()
-- XXX TODO: currently sync v2 does not support configuration compatibility check
local only_sync_v1 = rpc_sync == "on" and pending or describe

only_sync_v1("data planes with wasm disabled", function()
local node_id

lazy_setup(function()
Expand All @@ -311,7 +317,8 @@ describe("#wasm - hybrid mode #postgres" .. " rpc_sync=" .. rpc_sync, function()
nginx_conf = "spec/fixtures/custom_nginx.template",
wasm = "off",
node_id = node_id,
cluster_rpc_sync = rpc_sync,
cluster_rpc = rpc,
cluster_rpc_sync = rpc_sync,
}))
end)

Expand All @@ -329,7 +336,7 @@ describe("#wasm - hybrid mode #postgres" .. " rpc_sync=" .. rpc_sync, function()
end)
end)

describe("data planes missing one or more wasm filter", function()
only_sync_v1("data planes missing one or more wasm filter", function()
local tmp_dir
local node_id

Expand All @@ -351,7 +358,8 @@ describe("#wasm - hybrid mode #postgres" .. " rpc_sync=" .. rpc_sync, function()
wasm_filters = "user", -- don't enable bundled filters for this test
wasm_filters_path = tmp_dir,
node_id = node_id,
cluster_rpc_sync = rpc_sync,
cluster_rpc = rpc,
cluster_rpc_sync = rpc_sync,
}))
end)

Expand Down
Loading