Skip to content

Generate an empty JUnit report when no tests were run, rather than fail #3179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions .github/scripts/generate-junit-reports.sc
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ if !os.isDir(rootPath) then {
val reports: Seq[os.Path] = findFiles(Seq(rootPath))
println(s"Found ${reports.length} mill json reports:")
println(reports.mkString("\n"))
if reports.isEmpty then {
println("Error: no reports found!")
System.exit(1)
}
if reports.isEmpty then println("Warn: no reports found!")
println("Reading reports...")
val tests: Seq[Test] = reports.map(x => ujson.read(x.toNIO)).flatMap { json =>
json(1).value.asInstanceOf[ArrayBuffer[ujson.Obj]].map { test =>
Expand All @@ -91,10 +88,7 @@ val tests: Seq[Test] = reports.map(x => ujson.read(x.toNIO)).flatMap { json =>
}
}
println(s"Found ${tests.length} tests.")
if tests.isEmpty then {
println("Error: no tests found!")
System.exit(1)
}
if tests.isEmpty then println("Warn: no tests found!")
println("Generating JUnit XML report...")
val suites = tests.groupBy(_.fullyQualifiedName).map { case (suit, tests) =>
val testcases = tests.map { test =>
Expand Down
Loading