Skip to content

Commit

Permalink
chore: Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Allaman committed Oct 11, 2024
1 parent 26f9ced commit 483d265
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion plugin/kustomize.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ vim.api.nvim_create_user_command("KustomizeRun", function(opts)
local choice = opts.fargs[1]
local cmd = config.options.run[choice].cmd
local args = config.options.run[choice].args
local timeout = config.options.run[choice].timeout or 5000
local timeout = config.options.run[choice].timeout or 5000 -- TODO: refactor in one datastructure
run.run_checked(cmd, args, timeout)
end, {
desc = "Run commands",
Expand Down
8 changes: 4 additions & 4 deletions tests/kustomize/test_deprecations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ local want = {
describe("no deprecations", function()
it("No deprecations for 1.25", function()
table.insert(deprecations.args, "tests/kustomize/test_data/depreatations/pass.yaml")
local _, out = run.run(deprecations.cmd, deprecations.args)
local _, out = run.run(deprecations.cmd, deprecations.args, 5000)
table.remove(deprecations.args)
eq(out, {})
end)

it("Deprecation found for 1.25", function()
table.insert(deprecations.args, "tests/kustomize/test_data/deprecations/fail.yaml")
local _, out = run.run(deprecations.cmd, deprecations.args)
local _, out = run.run(deprecations.cmd, deprecations.args, 5000)
table.remove(deprecations.args)
eq(out, out)
end)
Expand All @@ -37,7 +37,7 @@ describe("no deprecations", function()
"-f",
"tests/kustomize/test_data/deprecations/fail.yaml",
}
local _, out = run.run(deprecations.cmd, deprecations.args)
local _, out = run.run(deprecations.cmd, deprecations.args, 5000)
table.remove(deprecations.args)
eq(out, {})
end)
Expand All @@ -46,7 +46,7 @@ describe("no deprecations", function()
table.insert(deprecations.args, "--output json") -- prevent colored output
table.insert(deprecations.args, "--foo")
table.insert(deprecations.args, "tests/kustomize/test_data/deprecations/fail.yaml")
local _, out = run.run(deprecations.cmd, deprecations.args)
local _, out = run.run(deprecations.cmd, deprecations.args, 5000)
eq(out, { "unknown flag: --foo" })
end)
end)
4 changes: 2 additions & 2 deletions tests/kustomize/test_validate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ local want = {
describe("validate", function()
it("valid Kubernetes deployment", function()
table.insert(validation.args, "tests/kustomize/test_data/validate/pass.yaml")
local _, out = run.run(validation.cmd, validation.args)
local _, out = run.run(validation.cmd, validation.args, 5000)
table.remove(validation.args)
eq(out, {})
end)

it("invalid Kubernetes deployment", function()
table.insert(validation.args, "tests/kustomize/test_data/validate/fail.yaml")
local _, out = run.run(validation.cmd, validation.args)
local _, out = run.run(validation.cmd, validation.args, 5000)
table.remove(validation.args)
eq(out, want)
end)
Expand Down

0 comments on commit 483d265

Please sign in to comment.