-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
.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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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()) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing newline
…into #809-Fix-parameterized-testing
…into #809-Fix-parameterized-testing # Conflicts: # test_runner/src/test/kotlin/ftl/run/platform/android/CreateAndroidTestContextKtTest.kt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 can't give approve
f915f2d
to
7796d4c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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