Skip to content

Commit

Permalink
Don't print test suite name if no test is being run
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarchambault committed May 9, 2024
1 parent 7f1cc60 commit 5968a44
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
28 changes: 14 additions & 14 deletions munit/shared/src/main/scala/munit/MUnitRunner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,20 @@ class MUnitRunner(val cls: Class[_ <: Suite], newInstance: () => Suite)
}
def runAsync(notifier: RunNotifier): Future[Unit] = {
val description = getDescription()
notifier.fireTestSuiteStarted(description)
runAll(notifier)
.transformCompat[Unit](result => {
result.failed.foreach(ex =>
fireFailedHiddenTest(notifier, "unexpected error running tests", ex)
)
notifier.fireTestSuiteFinished(description)
util.Success(())
})
if (PlatformCompat.isIgnoreSuite(cls) || munitTests.isEmpty) {
notifier.fireTestIgnored(description)
Future.successful(())
} else {
notifier.fireTestSuiteStarted(description)
runAll(notifier)
.transformCompat[Unit](result => {
result.failed.foreach(ex =>
fireFailedHiddenTest(notifier, "unexpected error running tests", ex)
)
notifier.fireTestSuiteFinished(description)
util.Success(())
})
}
}

private def runTests(
Expand Down Expand Up @@ -176,11 +181,6 @@ class MUnitRunner(val cls: Class[_ <: Suite], newInstance: () => Suite)
}

private def runAll(notifier: RunNotifier): Future[Unit] = {
if (PlatformCompat.isIgnoreSuite(cls) || munitTests.isEmpty) {
val description = getDescription()
notifier.fireTestIgnored(description)
return Future.successful(())
}
for {
beforeAll <- runBeforeAll(notifier)
_ <- {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ class Issue497FrameworkSuite extends FunSuite {
object Issue497FrameworkSuite
extends FrameworkTest(
classOf[Issue497FrameworkSuite],
"""|munit.Issue497FrameworkSuite:
|""".stripMargin,
"",
arguments = Array("--exclude-categories=munit.Slow"),
tags = Set(
OnlyJVM
Expand Down

0 comments on commit 5968a44

Please sign in to comment.