-
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
feat: add test targets for shard #1299
Conversation
Timestamp: 2020-11-18 16:42:11 |
Codecov Report
@@ Coverage Diff @@
## master #1299 +/- ##
============================================
- Coverage 79.55% 79.13% -0.43%
- Complexity 735 738 +3
============================================
Files 237 237
Lines 4579 4640 +61
Branches 796 808 +12
============================================
+ Hits 3643 3672 +29
- Misses 526 550 +24
- Partials 410 418 +8 |
53f2661
to
ba650e1
Compare
so you could do something like this
This should produce a result like:
|
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.
- Tested with filters
- Tested without filters
- Now output looks correct
num-flaky-test-attempts: 0
test-targets-for-shard:
- class com.example.test_app.bar.BarInstrumentedTest
- class com.example.test_app.foo.FooInstrumentedTest
Good work 👍
@@ -265,6 +265,20 @@ object ArgsHelper { | |||
|
|||
return shards.map { Chunk(find + it.testMethods.filterNot { method -> find.contains(method) }) } | |||
} | |||
|
|||
fun calculateDummyShards( |
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.
Do we really need 2 methods named calculateDummyShards
which both have only one call? IMO It's unnecessary redundancy. Besides that ArgHelper
will be refactored soon.
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 believe the intention was to be in line with the current implementation
flank/test_runner/src/main/kotlin/ftl/run/platform/android/CreateAndroidTestContext.kt
Lines 49 to 52 in 733e444
private fun InstrumentationTestContext.calculateShards( | |
args: AndroidArgs, | |
testFilter: TestFilter = TestFilters.fromTestTargets(args.testTargets) | |
): InstrumentationTestContext = ArgsHelper.calculateShards( |
As you mentioned, there will be a huge refactor soon so within this PR we either refactor all similar occurrences or leave it as it is
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.
removed the reference from ArgsHelper 👍
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.
@pawelpasterz I removed the reference from ArgsHelper. and merely moved the logic into the CreateAndroidTestContext
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.
Would be great to have a dedicated yml
config for each testable flank's feature. So, the config from the description could be placed in the repository.
[EDIT] My bad, it already is
@Mergifyio refresh |
Command
|
Fixes #1203
add test targets for shard
https://cloud.google.com/sdk/gcloud/reference/alpha/firebase/test/android/run#--test-targets-for-shard
Test Plan
Above is just a simple test plan, please, feel free to play around with this feature.
Checklist