rhyskeepence / clairvoyance
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
  """
Files Coverage
core/src/main/scala/clairvoyance 74.38%
scalatest/src/main/scala/clairvoyance/scalatest 60.29%
Project Totals (29 files) 67.94%
Notifications are pending CI completion. Periodically Codecov will check the CI state, when complete notifications will be submitted. Push notifications now.
141.1
TRAVIS_JDK_VERSION=openjdk11
TRAVIS_OS_NAME=linux
141.2
TRAVIS_JDK_VERSION=openjdk11
TRAVIS_OS_NAME=linux

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading