Skip to content

Commit

Permalink
[ci] print busted tests in the log as well as junit
Browse files Browse the repository at this point in the history
  • Loading branch information
mikz committed May 31, 2018
1 parent 0a05eda commit c186b81
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .busted
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ local default = {
}

if ci then
default.output = 'junit'
default.Xoutput = 'tmp/junit/busted.xml'
default.output = 'spec.ci_reporter'
end

return {
Expand Down
19 changes: 19 additions & 0 deletions spec/ci_reporter.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
local TAP = require('busted.outputHandlers.TAP')
local JUnit = require('busted.outputHandlers.junit')


return function(options)
local handler = require 'busted.outputHandlers.base'()

local tap = TAP(setmetatable({ }, { __index = options }))
local junit = JUnit(setmetatable({
arguments = { os.getenv('JUNIT_OUTPUT_FILE') },
}, { __index = options }))

function handler.subscribe(_, ...)
tap:subscribe(...)
junit:subscribe(...)
end

return handler
end

0 comments on commit c186b81

Please sign in to comment.