Fix parametrized tests#840
Conversation
Codecov Report
@@ Coverage Diff @@
## master #840 +/- ##
============================================
+ Coverage 81.23% 81.33% +0.09%
Complexity 637 637
============================================
Files 167 167
Lines 3240 3257 +17
Branches 463 468 +5
============================================
+ Hits 2632 2649 +17
Misses 343 343
Partials 265 265 |
| @@ -0,0 +1,4 @@ | |||
| gcloud: | |||
| app: ./src/test/kotlin/ftl/fixtures/tmp/apk/app-single-success-parametrized-debug.apk | |||
There was a problem hiding this comment.
Apks shouldn't be added directly to the flank repo, instead we keep them in https://github.com/Flank/test_artifacts to keep the flank repo size small
For the sample app, let's update the source code in this repo so we can easily rebuild the apks. As Android evolves, we'll want to rebuild apks with different options and target platforms.
| .flatMap { annotations -> annotations.values.values } | ||
| .filterIsInstance<DecodedValue.DecodedType>() | ||
| .map { it.value } | ||
| .any { it.toLowerCase().contains("Parameterized".toLowerCase()) }) { // sprawdzamy czy klasa zadana jako parametr adnotacji to Parameterized |
There was a problem hiding this comment.
I wonder if there are any other ways to define tests that can be identified by AndroidJUnitRunner as parameterized
| fun shouldHopefullyPass() { | ||
| assertTrue(paramOne == paramTwo.toInt()) | ||
| } | ||
| } No newline at end of file |
…into #809-Fix-parameterized-testing
…into #809-Fix-parameterized-testing # Conflicts: # test_runner/src/test/kotlin/ftl/run/platform/android/CreateAndroidTestContextKtTest.kt
adamfilipow92
left a comment
There was a problem hiding this comment.
👍 can't give approve
f915f2d to
7796d4c
Compare
jan-goral
left a comment
There was a problem hiding this comment.
I shrunk a little the implementation
…er::class) and @RunWith(Parameterized::class)
…into #809-Fix-parameterized-testing
| .any { it.isParameterizedAnnotation() } | ||
| } | ||
|
|
||
| private fun DecodedValue.DecodedType.isParameterizedAnnotation(): Boolean = |
There was a problem hiding this comment.
This is brilliant! ⭐
Fixes #809
Test Plan
When test will executed from Flank should have results like same test executed directly on testlab.
Additional information
Test directly executed from test lab
https://console.firebase.google.com/u/0/project/flank-open-source/testlab/histories/bh.da0c237aaa33732/matrices/8109159837961280691
Failed test executed from Flank
https://console.firebase.google.com/u/0/project/flank-open-source/testlab/histories/bh.da0c237aaa33732/matrices/8167982987416424556/executions/bs.38eda8775a39b098
and other with video
https://console.firebase.google.com/u/0/project/flank-open-source/testlab/histories/bh.da0c237aaa33732/matrices/7496090094871625048/executions/bs.160a4ed4fdc86abe
Checklist
Objectives
Parametrized tests classes should be run without splitting into single methods to avoid run errors.
Tests status
https://github.com/adamfilipow92/flank_parametrized_tests/tree/master/test_apk