Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tagantroy committed Jul 20, 2018
1 parent 72952f0 commit 8eb1fb4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ class ProbabilityBasedFlakinessStrategy(@JsonProperty("minSuccessRate") private
currentFailRate *= currentFailRate
counter++
}
} else {
output.add(it)
}
}
return testShard.copy(flakyTests = output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ class ProbabilityBasedFlakinessStrategySpek : Spek({
result.tests.size shouldBe 1
result.flakyTests.size shouldBe 2
}
it("should return zero flaky tests for one test with success rate 0.8") {
val metricsProvider = MetricsProviderStub(successRate = 0.8)
val result = strategy.process(testShard, metricsProvider)
result.tests.size shouldBe 1
result.flakyTests.size shouldBe 0
}
it("should return zero flaky tests for one test with success rate 1") {
val metricsProvider = MetricsProviderStub(successRate = 1.0)
val result = strategy.process(testShard, metricsProvider)
result.tests.size shouldBe 1
result.flakyTests.size shouldBe 0
}
it("should return one flaky test for one test with success rate = 0.7") {
val metricsProvider = MetricsProviderStub(successRate = 0.7)
val result = strategy.process(testShard, metricsProvider)
Expand Down

0 comments on commit 8eb1fb4

Please sign in to comment.