rhyskeepence / clairvoyance

Compare 9e6a29e ... +0 ... 30a11f4

Coverage Reach
core/src/main/scala/clairvoyance/export/FromSource.scala core/src/main/scala/clairvoyance/export/SpecificationFormatter.scala core/src/main/scala/clairvoyance/export/ClairvoyanceHtmlFileWriter.scala core/src/main/scala/clairvoyance/export/HtmlFormat.scala core/src/main/scala/clairvoyance/export/NaiveMultilineMethodNameJoiner.scala core/src/main/scala/clairvoyance/rendering/Reflection.scala core/src/main/scala/clairvoyance/rendering/Renderer.scala core/src/main/scala/clairvoyance/io/ClasspathResources.scala core/src/main/scala/clairvoyance/io/Files.scala core/src/main/scala/clairvoyance/plugins/CapturedCollaborators.scala core/src/main/scala/clairvoyance/plugins/SequenceDiagram.scala core/src/main/scala/clairvoyance/plugins/SvgSequenceDiagram.scala core/src/main/scala/clairvoyance/plugins/Graph.scala core/src/main/scala/clairvoyance/plugins/UmlMarkupGeneration.scala core/src/main/scala/clairvoyance/plugins/GraphVizDiagram.scala core/src/main/scala/clairvoyance/ProducesCapturedInputsAndOutputs.scala core/src/main/scala/clairvoyance/InterestingGivens.scala core/src/main/scala/clairvoyance/state/TestStates.scala core/src/main/scala/clairvoyance/CapturedInputsAndOutputs.scala scalatest/src/main/scala/clairvoyance/scalatest/export/ScalaTestHtmlFormat.scala scalatest/src/main/scala/clairvoyance/scalatest/export/ScalaTestEvents.scala scalatest/src/main/scala/clairvoyance/scalatest/export/ResultExtractor.scala scalatest/src/main/scala/clairvoyance/scalatest/export/ClairvoyanceHtmlPrinter.scala scalatest/src/main/scala/clairvoyance/scalatest/export/ScalaTestHtmlReporter.scala scalatest/src/main/scala/clairvoyance/scalatest/export/SuiteResults.scala scalatest/src/main/scala/clairvoyance/scalatest/export/ForwardingReporter.scala scalatest/src/main/scala/clairvoyance/scalatest/export/SingleClairvoyanceHtmlFileWriter.scala scalatest/src/main/scala/clairvoyance/scalatest/ClairvoyantContext.scala scalatest/src/main/scala/clairvoyance/scalatest/Tags.scala

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

Showing 1 of 2 files from the diff.

@@ -127,19 +127,31 @@
Loading
127 127
        suiteClassName,
128 128
        codeFormatFor(suiteClassName)
129 129
      )
130 -
      renderSpecificationHeader(testName, event.duration, spec)
130 +
      renderSpecificationHeader(testName, "success", event.duration, spec)
131 131
    } else ""
132 132
  }
133 133
134 -
  private def renderSpecificationHeader(testName: String, duration: Option[Long], spec: String) = {
134 +
135 +
  private def formatDuration(durationMillis: Long): List[String] = {
136 +
    durationMillis match {
137 +
      case millis if millis < 1000 =>
138 +
        List(s"${millis} ms")
139 +
      case millis if millis < 60000 =>
140 +
        List(s"${millis / 1000} s") ::: formatDuration(millis % 1000)
141 +
      case millis =>
142 +
        List(s"${millis / 60000} m") ::: formatDuration(millis % 60000)
143 +
    }
144 +
  }
145 +
146 +
  private def renderSpecificationHeader(testName: String, testStatus: String, duration: Option[Long], spec: String) =
135 147
    s"""
136 148
          <header>
137 149
            <h2>$testName</h2>
138 -
            ${duration.fold("")(milliseconds => s"""<div class="test-duration">$milliseconds ms</div>""")}
150 +
            <div class="test-status">${testStatus}</div>
151 +
            ${duration.map(formatDuration).fold("")(d => s"""<div class="test-duration">${d.mkString(" ")}</div>""")}
139 152
          </header>
140 153
          <code class="highlight specification">$spec</code>
141 154
        """
142 -
  }
143 155
144 156
  private def getCodeFrom(location: String, event: TestSucceeded): List[(Int, String)] = {
145 157
    event.location match {
@@ -180,7 +192,7 @@
Loading
180 192
          codeFormatFor(event.suiteClassName)
181 193
        )
182 194
183 -
        renderSpecificationHeader(event.testName, event.duration, spec)
195 +
        renderSpecificationHeader(event.testName, "failed", event.duration, spec)
184 196
      } else
185 197
        ""
186 198
    }
@@ -253,20 +265,18 @@
Loading
253 265
  }
254 266
255 267
  private def renderFragmentForBody(event: TestPendingOrIgnored): String = {
256 -
    println(event)
257 268
    s"""
258 -
    <a id={linkNameOf(event.testText)}></a>
269 +
    <a id="${linkNameOf(event.testText)}"></a>
259 270
    <div class="testmethod test-not-run">
260 271
      <div class="scenario" id=${event.testName.hashCode().toString}>
261 272
        ${
262 -
      renderSpecificationHeader(event.testName, None, SpecificationFormatter.format(
273 +
      renderSpecificationHeader(event.testName, event.name, None, SpecificationFormatter.format(
263 274
        FromSource.getCodeFrom(event.suiteClassName, event.testText),
264 275
        Seq.empty,
265 276
        event.suiteClassName,
266 277
        codeFormatFor(event.suiteClassName)
267 278
      ))
268 279
    }
269 -
        <pre class="highlight specification">${event.name}</pre>
270 280
      </div>
271 281
    </div>
272 282
  """

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
core/src/main/scala/clairvoyance 74.38%
scalatest/src/main/scala/clairvoyance/scalatest -0.01% 60.29%
Project Totals (29 files) 67.94%
Loading