From b2d5a23d218c670b30541adec7bfbcd55ac196ab Mon Sep 17 00:00:00 2001 From: Matthew Page <7774859+MatthewTPage@users.noreply.github.com> Date: Tue, 25 Aug 2020 04:33:37 -0700 Subject: [PATCH] Fix duplicate tests found (#1048) --- .../run/platform/android/CreateAndroidTestContext.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test_runner/src/main/kotlin/ftl/run/platform/android/CreateAndroidTestContext.kt b/test_runner/src/main/kotlin/ftl/run/platform/android/CreateAndroidTestContext.kt index cc97b1f2fd..a45dd0e118 100644 --- a/test_runner/src/main/kotlin/ftl/run/platform/android/CreateAndroidTestContext.kt +++ b/test_runner/src/main/kotlin/ftl/run/platform/android/CreateAndroidTestContext.kt @@ -64,11 +64,11 @@ private fun InstrumentationTestContext.getFlankTestMethods( ): List = getParametrizedClasses().let { parameterizedClasses: List -> 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.belong(method: TestMethod) = any { className -> method.testName.startsWith(className) }