refactor: pipelines now always run sequential

This commit is contained in:
Folke Lemaitre 2022-11-28 13:10:52 +01:00
parent 2abdc681fa
commit 3768256956
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
5 changed files with 45 additions and 57 deletions

View file

@ -1,7 +1,7 @@
local Runner = require("lazy.manage.runner")
describe("runner", function()
local plugins = { { name = "plugin1" }, { name = "plugin2" } }
local plugins = { { name = "plugin1", _ = {} }, { name = "plugin2", _ = {} } }
---@type {plugin:string, task:string}[]
local runs = {}
@ -10,6 +10,11 @@ describe("runner", function()
end)
package.loaded["lazy.manage.task.test"] = {}
package.loaded["lazy.manage.task.test"]["skip"] = {
skip = function()
return true
end,
}
for i = 1, 10 do
package.loaded["lazy.manage.task.test"]["test" .. i] = {
---@param task LazyTask
@ -32,6 +37,12 @@ describe("runner", function()
assert.equal(4, #runs)
end)
it("handles skips", function()
local runner = Runner.new({ plugins = plugins, pipeline = { "test.test1", "test.skip", "test.test2" } })
runner:start()
assert.equal(4, #runs)
end)
it("aborts on error", function()
local runner = Runner.new({ plugins = plugins, pipeline = { "test.test1", "test.error1", "test.test2" } })
runner:start()