Skip to content
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

Don't print test suite name if no test is being run #779

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
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
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