File tree 6 files changed +38
-17
lines changed
test_projects/android/app/src
androidTestMultiple/java/com.example.test_app
androidTestSingle/java/com.example.test_app
main/kotlin/ftl/run/platform/android
6 files changed +38
-17
lines changed Original file line number Diff line number Diff line change 1
1
## next (unreleased)
2
2
- [ #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
+ -
3
5
-
4
6
5
7
## v20.08.1
Original file line number Diff line number Diff line change 1
1
package com.example.test_app
2
2
3
3
import androidx.test.ext.junit.runners.AndroidJUnit4
4
+ import androidx.test.filters.Suppress
4
5
import org.junit.Ignore
5
6
import org.junit.Test
6
7
import org.junit.runner.RunWith
@@ -22,9 +23,9 @@ class InstrumentedTest : BaseInstrumentedTest() {
22
23
23
24
@Test
24
25
@Ignore(" For testing purpose: https://github.com/Flank/flank/issues/852" )
25
- fun ignoredTest1 () = testMethod()
26
+ fun ignoredTestWithIgnore () = testMethod()
26
27
27
28
@Test
28
- @Ignore( " For testing purpose: https://github.com/Flank/flank/issues/852 " )
29
- fun ignoredTest2 () = testMethod()
29
+ @Suppress
30
+ fun ignoredTestWitSuppress () = testMethod()
30
31
}
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package com.example.test_app
2
2
3
3
import androidx.test.ext.junit.runners.AndroidJUnit4
4
4
import org.junit.Ignore
5
+ import androidx.test.filters.Suppress
5
6
import org.junit.Test
6
7
import org.junit.runner.RunWith
7
8
@@ -13,9 +14,9 @@ class InstrumentedTest : BaseInstrumentedTest() {
13
14
14
15
@Test
15
16
@Ignore(" For testing purpose: https://github.com/Flank/flank/issues/852" )
16
- fun ignoredTest () = testMethod()
17
+ fun ignoredTestWithIgnore () = testMethod()
17
18
18
19
@Test
19
- @Ignore( " For testing purpose: https://github.com/Flank/flank/issues/852 " )
20
- fun ignoredTest2 () = testMethod()
20
+ @Suppress
21
+ fun ignoredTestWithSuppress () = testMethod()
21
22
}
Original file line number Diff line number Diff line change @@ -73,7 +73,16 @@ private fun InstrumentationTestContext.getFlankTestMethods(
73
73
74
74
private fun List<String>.belong (method : TestMethod ) = any { className -> method.testName.startsWith(className) }
75
75
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
+ )
77
86
78
87
private fun String.toFlankTestMethod () = FlankTestMethod (" class $this " , ignored = false )
79
88
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ class DumpShardsKtTest {
28
28
]
29
29
},
30
30
"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 "
33
33
]
34
34
},
35
35
"matrix-1": {
@@ -84,8 +84,8 @@ class DumpShardsKtTest {
84
84
]
85
85
},
86
86
"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 "
89
89
]
90
90
},
91
91
"matrix-1": {
@@ -107,8 +107,8 @@ class DumpShardsKtTest {
107
107
]
108
108
},
109
109
"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 ",
112
112
"class com.example.test_app.bar.BarInstrumentedTest#ignoredTestBar",
113
113
"class com.example.test_app.foo.FooInstrumentedTest#ignoredTestFoo"
114
114
]
Original file line number Diff line number Diff line change @@ -11,8 +11,7 @@ class IgnoreTestsAnnotationTest {
11
11
private val singleSuccessYaml = TestHelper .getPath(" src/test/kotlin/ftl/fixtures/test_app_cases/flank-single-success.yml" )
12
12
13
13
@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` () {
16
15
val testContext = runBlocking {
17
16
AndroidArgs .load(singleSuccessYaml).createAndroidTestContexts()
18
17
}.single() as InstrumentationTestContext
@@ -21,12 +20,21 @@ class IgnoreTestsAnnotationTest {
21
20
}
22
21
23
22
@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` () {
25
33
26
34
val testContext = runBlocking {
27
35
AndroidArgs .load(singleSuccessYaml).createAndroidTestContexts()
28
36
}.single() as InstrumentationTestContext
29
37
30
- Assert .assertFalse(testContext.shards.flatten().any { it.contains(" #ignoredTest " ) })
38
+ Assert .assertFalse(testContext.shards.flatten().any { it.contains(" #ignoredTestWithSuppress " ) })
31
39
}
32
40
}
You can’t perform that action at this time.
0 commit comments