mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-23 22:25:26 +00:00
Make script exit with code 1 when tests fail
This commit is contained in:
@@ -88,9 +88,18 @@ for _, log in logs do
|
|||||||
stdio.write(`{stdio.color("reset")}\n`)
|
stdio.write(`{stdio.color("reset")}\n`)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local results = luau_execute.get_output(task)[1]
|
||||||
|
if not results then
|
||||||
|
error("plugin tests did not return any results")
|
||||||
|
end
|
||||||
|
|
||||||
local status = luau_execute.check_status(task)
|
local status = luau_execute.check_status(task)
|
||||||
if status == "COMPLETE" then
|
if status == "COMPLETE" then
|
||||||
process.exit(0)
|
if results.failureCount == 0 then
|
||||||
|
process.exit(0)
|
||||||
|
else
|
||||||
|
process.exit(1)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
print()
|
print()
|
||||||
print("Task did not finish successfully")
|
print("Task did not finish successfully")
|
||||||
|
|||||||
@@ -8,4 +8,12 @@ local Settings = require(Rojo.Plugin.Settings)
|
|||||||
Settings:set("logLevel", "Trace")
|
Settings:set("logLevel", "Trace")
|
||||||
Settings:set("typecheckingEnabled", true)
|
Settings:set("typecheckingEnabled", true)
|
||||||
|
|
||||||
require(Rojo.Plugin.runTests)(TestEZ)
|
local results = require(Rojo.Plugin.runTests)(TestEZ)
|
||||||
|
|
||||||
|
-- Roblox's Luau execution gets mad about cyclical tables.
|
||||||
|
-- Rather than making TestEZ not do that, we just send back the important info.
|
||||||
|
return {
|
||||||
|
failureCount = results.failureCount,
|
||||||
|
successCount = results.successCount,
|
||||||
|
skippedCount = results.skippedCount,
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ return function(TestEZ)
|
|||||||
local Rojo = script.Parent.Parent
|
local Rojo = script.Parent.Parent
|
||||||
local Packages = Rojo.Packages
|
local Packages = Rojo.Packages
|
||||||
|
|
||||||
TestEZ.TestBootstrap:run({ Rojo.Plugin, Packages.Http, Packages.Log, Packages.RbxDom })
|
return TestEZ.TestBootstrap:run({ Rojo.Plugin, Packages.Http, Packages.Log, Packages.RbxDom })
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user