diff --git a/test_projects/android/app/src/androidTestMultiple/java/com.example.test_app.similar/SimilarNameTest1.kt b/test_projects/android/app/src/androidTestMultiple/java/com.example.test_app.similar/SimilarNameTest1.kt new file mode 100644 index 0000000000..1970401015 --- /dev/null +++ b/test_projects/android/app/src/androidTestMultiple/java/com.example.test_app.similar/SimilarNameTest1.kt @@ -0,0 +1,21 @@ +package com.example.test_app.similar + +import androidx.test.ext.junit.runners.AndroidJUnit4 +import com.example.test_app.BaseInstrumentedTest +import org.junit.Ignore +import androidx.test.filters.Suppress +import org.junit.Test +import org.junit.runner.RunWith + +@RunWith(AndroidJUnit4::class) +class SimilarNameTest1 : BaseInstrumentedTest() { + + @Test + fun test1() = testMethod() + + @Test + fun test2() = testMethod() + + @Test + fun test19() = testMethod() +} diff --git a/test_projects/android/app/src/androidTestMultiple/java/com.example.test_app.similar/SimilarNameTest10.kt b/test_projects/android/app/src/androidTestMultiple/java/com.example.test_app.similar/SimilarNameTest10.kt new file mode 100644 index 0000000000..d7ffe9ceee --- /dev/null +++ b/test_projects/android/app/src/androidTestMultiple/java/com.example.test_app.similar/SimilarNameTest10.kt @@ -0,0 +1,21 @@ +package com.example.test_app.similar + +import androidx.test.ext.junit.runners.AndroidJUnit4 +import com.example.test_app.BaseInstrumentedTest +import org.junit.Ignore +import androidx.test.filters.Suppress +import org.junit.Test +import org.junit.runner.RunWith + +@RunWith(AndroidJUnit4::class) +class SimilarNameTest10 : BaseInstrumentedTest() { + + @Test + fun test1() = testMethod() + + @Test + fun test2() = testMethod() + + @Test + fun test19() = testMethod() +} 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 03f7c36da4..9d56e81392 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 @@ -70,7 +70,9 @@ internal fun InstrumentationTestContext.getFlankTestMethods( .filter(testFilter.shouldRun) .filterNot(parameterizedClasses::belong) .map(TestMethod::toFlankTestMethod).toList() - .plus(parameterizedClasses.map(String::toFlankTestMethod)) + .plus(parameterizedClasses + .filter { testFilter.shouldRun(TestMethod(it, emptyList())) } + .map(String::toFlankTestMethod)) } private fun List.belong(method: TestMethod) = any { className -> method.testName.startsWith(className) }