Skip to content

Commit

Permalink
fix(ci): test scheduler busted helper
Browse files Browse the repository at this point in the history
We use `busted.subscribe` to override the output handlers with a
callback. To implement the mediator pattern, Busted uses
[mediator_lua](https://github.com/Olivine-Labs/mediator_lua).

The second value returned by the subscription callback is used to decide
whether to continue execution of other subscribers. Since we only return
`nil`, the test failure was not handled to exit with the right status
and failing tests were exiting with `0`.

This commit changes the return value of the callback to: `nil, true` so
that the original callback is executed to handle the test result and
return the correct exit status.
  • Loading branch information
samugi committed Feb 14, 2024
1 parent b0bce58 commit 246fd30
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions spec/busted-ci-helper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ if busted_event_path then
end

sock:send(cjson.encode({ event = event[1] .. (event[2] and ":" .. event[2] or ""), args = args }) .. "\n")
return nil, true --continue
end)
end
end

0 comments on commit 246fd30

Please sign in to comment.