Skip to content

Commit 2bc8faf

Browse files
authored
Treat classnames with only skipped tests as having taken 0 time (apache-spark-on-k8s#336)
1 parent 06290c1 commit 2bc8faf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

project/CirclePlugin.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ object CirclePlugin extends AutoPlugin {
5858

5959
case class TestKey(source: String, classname: String)
6060

61-
// Through this magical command we established that the average class run_time is 7.737
61+
// Through this magical command we established that the average class run_time is 8.841
6262
// jq <~/results.json '.tests | map(select(.result != "skipped")) | group_by(.classname) | map(map(.run_time) | add) | (add / length)'
63-
private[this] val AVERAGE_TEST_CLASS_RUN_TIME = 7.737d
63+
private[this] val AVERAGE_TEST_CLASS_RUN_TIME = 8.841d
6464

6565
override def globalSettings: Seq[Def.Setting[_]] = List(
6666
circleTestsByProject := {
@@ -109,9 +109,9 @@ object CirclePlugin extends AutoPlugin {
109109
.map(_.asScala)
110110
.getOrElse(Iterator())
111111
.toStream
112-
.filter(_.result != "skipped") // don't count timings of tests that didn't run
113112
.groupBy(result => TestKey(result.source, result.classname))
114-
.mapValues(_.foldLeft(0.0d)(_ + _.run_time))
113+
// don't count timings on skipped tests, but remember we've seen the classname
114+
.mapValues(_.filter(_.result != "skipped").foldLeft(0.0d)(_ + _.run_time))
115115
} catch {
116116
case e: Exception =>
117117
log.warn(f"Couldn't read test results file: $testResultsFile")

0 commit comments

Comments
 (0)