Skip to content

Commit

Permalink
Fix duplicate tests found
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewThomasPage committed Aug 25, 2020
1 parent a2340aa commit b0687ac
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ private fun InstrumentationTestContext.getFlankTestMethods(
): List<FlankTestMethod> =
getParametrizedClasses().let { parameterizedClasses: List<String> ->
DexParser.findTestMethods(test.local).asSequence()
.distinct()
.filter(testFilter.shouldRun)
.filterNot(parameterizedClasses::belong)
.map(TestMethod::toFlankTestMethod).toList()
.plus(parameterizedClasses.map(String::toFlankTestMethod))
.distinctBy { it.testName }
.filter(testFilter.shouldRun)
.filterNot(parameterizedClasses::belong)
.map(TestMethod::toFlankTestMethod).toList()
.plus(parameterizedClasses.map(String::toFlankTestMethod))
}

private fun List<String>.belong(method: TestMethod) = any { className -> method.testName.startsWith(className) }
Expand Down

0 comments on commit b0687ac

Please sign in to comment.