test: fix tests

This commit is contained in:
Folke Lemaitre 2024-06-26 18:42:52 +02:00
parent 6c7ef7e27a
commit 206d208018
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
3 changed files with 16 additions and 15 deletions

View file

@ -81,7 +81,7 @@ function Runner:_start()
---@param resume? boolean
local function continue(resume)
active = #names
active = 0
waiting = 0
wait_step = nil
for _, name in ipairs(names) do
@ -90,19 +90,18 @@ function Runner:_start()
local running = s.task and s.task:is_running()
local step = self._pipeline[s.step]
if step and step.task == "wait" and not resume then
if s.task and s.task:has_errors() then
local ignore = true
elseif step and step.task == "wait" and not resume then
waiting = waiting + 1
active = active - 1
wait_step = s.step
elseif not running then
local plugin = self:plugin(name)
if s.task and s.task:has_errors() then
active = active - 1
elseif s.step == #self._pipeline then
if s.step == #self._pipeline then
s.task = nil
active = active - 1
plugin._.working = false
elseif s.step < #self._pipeline then
active = active + 1
s.step = s.step + 1
step = self._pipeline[s.step]
if step.task == "wait" then
@ -112,6 +111,8 @@ function Runner:_start()
plugin._.working = not not s.task
end
end
else
active = active + 1
end
end
end

View file

@ -182,7 +182,7 @@ function Task:spawn(cmd, opts)
local running = true
---@param output string
function opts.on_exit(ok, output)
self:log(output, ok and vim.log.levels.DEBUG or vim.log.levels.ERROR)
self:log(vim.trim(output), ok and vim.log.levels.DEBUG or vim.log.levels.ERROR)
if on_exit then
pcall(on_exit, ok, output)
end