Skip to content

Commit

Permalink
Generate an empty JUnit report when no tests were run, rather than fa…
Browse files Browse the repository at this point in the history
…il (#3179)
  • Loading branch information
Gedochao authored Sep 18, 2024
1 parent 146214e commit 56f14fe
Showing 1 changed file with 2 additions and 8 deletions.
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

0 comments on commit 56f14fe

Please sign in to comment.