local O=game:GetService("\084\101\115\116\083\101\114\118\105\099\101")local m=require(script.Parent.Parent.TestEnum)local e=(" "):rep(3)local M={[m.TestStatus.Success]="\043",[m.TestStatus.Failure]="-",[m.TestStatus.Skipped]="~"}local T="\063"local a={}local function E(O,a,t)a=a or{}t=t or 0 if O.status==m.TestStatus.Skipped then return a end local A if O.status~=m.TestStatus.Success then local m=M[O.status]or T A=("\037\115\091\037\115\093 \037\115"):format(e:rep(t),m,O.planNode.phrase)end table.insert(a,A)for O,m in ipairs(O.children)do E(m,a,t+1)end return a end local function t(O)local m={}for O,e in ipairs(O.children)do E(e,m,0)end return m end local function A(O)local m=t(O)return table.concat(m,"\n")end function a.report(m)local e={"\084\101\115\116 \114\101\115\117\108\116\115\058",A(m),("\037\100 \112\097\115\115\101\100\044 \037\100 \102\097\105\108\101\100\044 \037\100 \115\107\105\112\112\101\100"):format(m.successCount,m.failureCount,m.skippedCount)}print(table.concat(e,"\n"))if m.failureCount>0 then print(("\037\100 \116\101\115\116 \110\111\100\101\115 \114\101\112\111\114\116\101\100 \102\097\105\108\117\114\101\115\046"):format(m.failureCount))end if#m.errors>0 then print("\069\114\114\111\114\115 \114\101\112\111\114\116\101\100 \098\121 \116\101\115\116\115\058")print("")for m,e in ipairs(m.errors)do O:Error(e)print("")end end end return a
--[[
	Copy of TextReporter that doesn't output successful tests.

	This should be temporary, it's just a workaround to make CI environments
	happy in the short-term.
]]

local TestService = game:GetService("TestService")

local TestEnum = require(script.Parent.Parent.TestEnum)

local INDENT = (" "):rep(3)
local STATUS_SYMBOLS = {
	[TestEnum.TestStatus.Success] = "+",
	[TestEnum.TestStatus.Failure] = "-",
	[TestEnum.TestStatus.Skipped] = "~",
}
local UNKNOWN_STATUS_SYMBOL = "?"

local TextReporterQuiet = {}

local function reportNode(node, buffer, level)
	buffer = buffer or {}
	level = level or 0

	if node.status == TestEnum.TestStatus.Skipped then
		return buffer
	end

	local line

	if node.status ~= TestEnum.TestStatus.Success then
		local symbol = STATUS_SYMBOLS[node.status] or UNKNOWN_STATUS_SYMBOL

		line = ("%s[%s] %s"):format(INDENT:rep(level), symbol, node.planNode.phrase)
	end

	table.insert(buffer, line)

	for _, child in ipairs(node.children) do
		reportNode(child, buffer, level + 1)
	end

	return buffer
end

local function reportRoot(node)
	local buffer = {}

	for _, child in ipairs(node.children) do
		reportNode(child, buffer, 0)
	end

	return buffer
end

local function report(root)
	local buffer = reportRoot(root)

	return table.concat(buffer, "\n")
end

function TextReporterQuiet.report(results)
	local resultBuffer = {
		"Test results:",
		report(results),
		("%d passed, %d failed, %d skipped"):format(results.successCount, results.failureCount, results.skippedCount),
	}

	print(table.concat(resultBuffer, "\n"))

	if results.failureCount > 0 then
		print(("%d test nodes reported failures."):format(results.failureCount))
	end

	if #results.errors > 0 then
		print("Errors reported by tests:")
		print("")

		for _, message in ipairs(results.errors) do
			TestService:Error(message)

			-- Insert a blank line after each error
			print("")
		end
	end
end

return TextReporterQuiet
