Skip to content

Commit

Permalink
Merge pull request #74 from Malinskiy/bugfix/probability_flakiness_st…
Browse files Browse the repository at this point in the history
…rategy

ProbabilityBasedFlakinessStrategy fix
  • Loading branch information
tagantroy authored Jul 20, 2018
2 parents 72952f0 + 8eb1fb4 commit 2272ffc
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 2272ffc

Please sign in to comment.