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

Add a cause to the munit Checker failure #1564

Merged
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: 8 additions & 2 deletions modules/munit/src/main/scala/doobie/munit/analysisspec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package doobie.munit

import cats.effect.{IO, Async}
import doobie.munit.analysisspec.Checker.ErrorItems
import doobie.syntax.connectionio._
import doobie.util.query.{Query0, Query}
import doobie.util.testing._
Expand Down Expand Up @@ -51,14 +52,19 @@ object analysisspec {
val report = U.unsafeRunSync(analyze(args).transact(transactor))
if (!report.succeeded) {
fail(
formatReport(args, report, colors)
message = formatReport(args, report, colors)
.padLeft(" ")
.toString
.toString,
cause = ErrorItems(report.items.filter(_.error.isDefined))
)
}
}
}

object Checker {
case class ErrorItems(errors: List[AnalysisReport.Item]) extends Exception
}

/** Implementation of Checker[IO] */
trait IOChecker extends Checker[IO] {
self: Assertions =>
Expand Down