typelevel / typelevel/doobie

Scalatest output

Open
#406 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
2.2k
Forks
379
Avg merge
14m
Merged PRs (30d)
8

Description

This seems like a bug where no output is printed on a successful test.

I've modified it in my own project to this which seems to work:

val analysisOutput = transactor.trans(analysis).attempt.unsafePerformIO match {
  case -\/(e) =>
    failure("SQL fails typechecking", formatError(e.getMessage))
  case \/-(a) =>
    success("SQL compiles and typechecks", None) +
      a.paramDescriptions.map { case (s, es) => assertEmpty(s, es) }
        .map(s => s"  $s")
        .mkString +
      a.columnDescriptions.map { case (s, es) => assertEmpty(s, es) }
        .map(s => s"  $s")
        .mkString
}

println(
  s"  $typeName defined at ${loc(pos)}\n" +
    formatSql(sql) +
    analysisOutput
)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at yax/scalatest/src/main/scala/doobie/scalatest/QueryChecker.scala around line 78 and inspect the successful analysis-output path. Compare it with the proposed output behavior in the issue, then run the relevant ScalaTest checks to confirm successful tests print the SQL analysis while failure output remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.