File tree Expand file tree Collapse file tree
test_projects/android/app/src
androidTestMultiple/java/com.example.test_app
androidTestSingle/java/com.example.test_app
main/kotlin/ftl/run/platform/android Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11## next (unreleased)
22- [ #987 ] ( https://github.com/Flank/flank/pull/987 ) Flank Error Monitoring readme addition ([ sloox] ( https://github.com/Sloox ) )
3+ - [ #990 ] ( https://github.com/Flank/flank/pull/990 ) Fix: exclusion of @Suppress test. ([ piotradamczyk5] ( https://github.com/piotradamczyk5 ) )
4+ -
35-
46
57## v20.08.1
Original file line number Diff line number Diff line change 11package com.example.test_app
22
33import androidx.test.ext.junit.runners.AndroidJUnit4
4+ import androidx.test.filters.Suppress
45import org.junit.Ignore
56import org.junit.Test
67import org.junit.runner.RunWith
@@ -22,9 +23,9 @@ class InstrumentedTest : BaseInstrumentedTest() {
2223
2324 @Test
2425 @Ignore(" For testing purpose: https://github.com/Flank/flank/issues/852" )
25- fun ignoredTest1 () = testMethod()
26+ fun ignoredTestWithIgnore () = testMethod()
2627
2728 @Test
28- @Ignore( " For testing purpose: https://github.com/Flank/flank/issues/852 " )
29- fun ignoredTest2 () = testMethod()
29+ @Suppress
30+ fun ignoredTestWitSuppress () = testMethod()
3031}
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package com.example.test_app
22
33import androidx.test.ext.junit.runners.AndroidJUnit4
44import org.junit.Ignore
5+ import androidx.test.filters.Suppress
56import org.junit.Test
67import org.junit.runner.RunWith
78
@@ -13,9 +14,9 @@ class InstrumentedTest : BaseInstrumentedTest() {
1314
1415 @Test
1516 @Ignore(" For testing purpose: https://github.com/Flank/flank/issues/852" )
16- fun ignoredTest () = testMethod()
17+ fun ignoredTestWithIgnore () = testMethod()
1718
1819 @Test
19- @Ignore( " For testing purpose: https://github.com/Flank/flank/issues/852 " )
20- fun ignoredTest2 () = testMethod()
20+ @Suppress
21+ fun ignoredTestWithSuppress () = testMethod()
2122}
Original file line number Diff line number Diff line change @@ -73,7 +73,16 @@ private fun InstrumentationTestContext.getFlankTestMethods(
7373
7474private fun List<String>.belong (method : TestMethod ) = any { className -> method.testName.startsWith(className) }
7575
76- private fun TestMethod.toFlankTestMethod () = FlankTestMethod (" class $testName " , ignored = annotations.any { it.name == " org.junit.Ignore" })
76+ private fun TestMethod.toFlankTestMethod () = FlankTestMethod (
77+ testName = " class $testName " ,
78+ ignored = annotations.any { it.name in ignoredAnnotations }
79+ )
80+
81+ private val ignoredAnnotations = listOf (
82+ " org.junit.Ignore" ,
83+ " androidx.test.filters.Suppress" ,
84+ " android.support.test.filters.Suppress"
85+ )
7786
7887private fun String.toFlankTestMethod () = FlankTestMethod (" class $this " , ignored = false )
7988
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ class DumpShardsKtTest {
2828 ]
2929 },
3030 "junit-ignored": [
31- "class com.example.test_app.InstrumentedTest#ignoredTest ",
32- "class com.example.test_app.InstrumentedTest#ignoredTest2 "
31+ "class com.example.test_app.InstrumentedTest#ignoredTestWithIgnore ",
32+ "class com.example.test_app.InstrumentedTest#ignoredTestWithSuppress "
3333 ]
3434 },
3535 "matrix-1": {
@@ -84,8 +84,8 @@ class DumpShardsKtTest {
8484 ]
8585 },
8686 "junit-ignored": [
87- "class com.example.test_app.InstrumentedTest#ignoredTest ",
88- "class com.example.test_app.InstrumentedTest#ignoredTest2 "
87+ "class com.example.test_app.InstrumentedTest#ignoredTestWithIgnore ",
88+ "class com.example.test_app.InstrumentedTest#ignoredTestWithSuppress "
8989 ]
9090 },
9191 "matrix-1": {
@@ -107,8 +107,8 @@ class DumpShardsKtTest {
107107 ]
108108 },
109109 "junit-ignored": [
110- "class com.example.test_app.InstrumentedTest#ignoredTest1 ",
111- "class com.example.test_app.InstrumentedTest#ignoredTest2 ",
110+ "class com.example.test_app.InstrumentedTest#ignoredTestWithIgnore ",
111+ "class com.example.test_app.InstrumentedTest#ignoredTestWithSuppress ",
112112 "class com.example.test_app.bar.BarInstrumentedTest#ignoredTestBar",
113113 "class com.example.test_app.foo.FooInstrumentedTest#ignoredTestFoo"
114114 ]
Original file line number Diff line number Diff line change @@ -11,8 +11,7 @@ class IgnoreTestsAnnotationTest {
1111 private val singleSuccessYaml = TestHelper .getPath(" src/test/kotlin/ftl/fixtures/test_app_cases/flank-single-success.yml" )
1212
1313 @Test
14- fun `InstrumentationContext with @Ignore annotation should have items in ignoredTestCases` () {
15-
14+ fun `InstrumentationContext with @Ignore or @Suppress annotation should have items in ignoredTestCases` () {
1615 val testContext = runBlocking {
1716 AndroidArgs .load(singleSuccessYaml).createAndroidTestContexts()
1817 }.single() as InstrumentationTestContext
@@ -21,12 +20,21 @@ class IgnoreTestsAnnotationTest {
2120 }
2221
2322 @Test
24- fun `InstrumentationContext with @Ignore annotation should't have ignoredTestCases in shards` () {
23+ fun `InstrumentationContext with @Ignore annotation shouldn't have ignoredTestCases in shards` () {
24+ val testContext = runBlocking {
25+ AndroidArgs .load(singleSuccessYaml).createAndroidTestContexts()
26+ }.single() as InstrumentationTestContext
27+
28+ Assert .assertFalse(testContext.shards.flatten().any { it.contains(" #ignoredTestWithIgnore" ) })
29+ }
30+
31+ @Test
32+ fun `InstrumentationContext with @Supress annotation shouldn't have ignoredTestCases in shards` () {
2533
2634 val testContext = runBlocking {
2735 AndroidArgs .load(singleSuccessYaml).createAndroidTestContexts()
2836 }.single() as InstrumentationTestContext
2937
30- Assert .assertFalse(testContext.shards.flatten().any { it.contains(" #ignoredTest " ) })
38+ Assert .assertFalse(testContext.shards.flatten().any { it.contains(" #ignoredTestWithSuppress " ) })
3139 }
3240}
You can’t perform that action at this time.
0 commit comments