Skip to content

Commit 56f14fe

Browse files
authored
Generate an empty JUnit report when no tests were run, rather than fail (#3179)
1 parent 146214e commit 56f14fe

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

.github/scripts/generate-junit-reports.sc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,7 @@ if !os.isDir(rootPath) then {
6262
val reports: Seq[os.Path] = findFiles(Seq(rootPath))
6363
println(s"Found ${reports.length} mill json reports:")
6464
println(reports.mkString("\n"))
65-
if reports.isEmpty then {
66-
println("Error: no reports found!")
67-
System.exit(1)
68-
}
65+
if reports.isEmpty then println("Warn: no reports found!")
6966
println("Reading reports...")
7067
val tests: Seq[Test] = reports.map(x => ujson.read(x.toNIO)).flatMap { json =>
7168
json(1).value.asInstanceOf[ArrayBuffer[ujson.Obj]].map { test =>
@@ -91,10 +88,7 @@ val tests: Seq[Test] = reports.map(x => ujson.read(x.toNIO)).flatMap { json =>
9188
}
9289
}
9390
println(s"Found ${tests.length} tests.")
94-
if tests.isEmpty then {
95-
println("Error: no tests found!")
96-
System.exit(1)
97-
}
91+
if tests.isEmpty then println("Warn: no tests found!")
9892
println("Generating JUnit XML report...")
9993
val suites = tests.groupBy(_.fullyQualifiedName).map { case (suit, tests) =>
10094
val testcases = tests.map { test =>

0 commit comments

Comments
 (0)