Skip to content

Commit

Permalink
Fix duplicate tests found (#1048)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewTPage authored and adamfilipow92 committed Aug 25, 2020
1 parent accb20b commit 1706812
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 1706812

Please sign in to comment.