Add support for robo-directives & robo-script options#709
Conversation
63265ed to
00f6817
Compare
Codecov Report
@@ Coverage Diff @@
## master #709 +/- ##
============================================
- Coverage 79.48% 78.22% -1.27%
- Complexity 666 676 +10
============================================
Files 113 125 +12
Lines 2696 2787 +91
Branches 385 402 +17
============================================
+ Hits 2143 2180 +37
- Misses 305 348 +43
- Partials 248 259 +11 |
|
There is a little bit more work to do here. Android instrumentation tests and robo tests are mutually exclusive, they cannot be specified both. It requires additional changes how args are validated and test matrix build. |
| ## The path may be in the local filesystem or in Google Cloud Storage using gs:// notation. | ||
| ## You can guide the Robo test to perform specific actions by recording a Robo Script in Android Studio and then specifying this argument. | ||
| ## Learn more at https://firebase.google.com/docs/test-lab/robo-ux-test#scripting. | ||
| # robo-script: path_to_robo_script |
There was a problem hiding this comment.
Nice work! Remember to update readme.md as well.
There was a problem hiding this comment.
I've updated bunch of config options in README.md and flank.yml because both of them had lack of some updates.
|
For new features from gcloud, it's good to test the yaml syntax with gcloud CLI.
I'd test and confirm that robo-directives and robo-script works well both from Flank and gcloud. |
00f6817 to
401b93b
Compare
* Prevent crash by null testSuiteOverviews when using robo test * Prepare test_app for robo test * Add robo script to fixtures
Thanks for advise, that was helpful to keep yml config consistent with gcloud. I tested robo-directives and robo-script with Flank and |
| "success" -> true | ||
| "error" -> false | ||
| "flaky" -> SystemClock.uptimeMillis() % 2 == 0L | ||
| "flaky" -> Random.nextBoolean() |
| ) | ||
|
|
||
| if (!(isRoboTest xor isInstrumentationTest)) throw FlankFatalError( | ||
| "Option test xor robo-directives xor robo-script must be specified" |
There was a problem hiding this comment.
How about xor -> or?
Maybe we could use sth like One of bla bla bla. Just thinking
There was a problem hiding this comment.
Flank is for programmers not end users, I guess every programmer knows what xor does mean. Anyway if you propose something better than One of bla bla bla ;), I can replace.
There was a problem hiding this comment.
we have a community of QA engineers using Firebase Test Lab, they may not be familiar with what xor means 🙂
| get() = if (input.isNotBlank()) input else "\"\"" | ||
| } | ||
|
|
||
| fun List<String>.parseRoboDirectives() = map { |
There was a problem hiding this comment.
List<String>#parseRoboDirectives and Map<...>#parseRoboDirectives are only used inside AndroidArgs class. How about moving those there and make private?
There was a problem hiding this comment.
I put those mappers here because AndroidArgs has over 200 lines and do to much.
| override val extension = ".txt" | ||
|
|
||
| private val percentFormat by lazy { DecimalFormat("#0.00") } | ||
| private val percentFormat by lazy { DecimalFormat("#0.00", DecimalFormatSymbols(Locale.US)) } |
There was a problem hiding this comment.
Why this change? Previous implementation takes default locale
public DecimalFormat(String pattern) {
// Always applyPattern after the symbols are set
this.symbols = DecimalFormatSymbols.getInstance(Locale.getDefault(Locale.Category.FORMAT));
applyPattern(pattern, false);
}
I am just curious
There was a problem hiding this comment.
Because defaults on some locales change . into , which breaks 3 unit tests. That fix is required because in commit 18b72b5 maven( url = "https://maven-central.storage-download.googleapis.com/repos/central/data/" ) was changed to jcenter() I guess.
There was a problem hiding this comment.
I moved to jcenter since the old URL was causing build failures locally and is non-standard.
I think this code is related to printing the cost in US dollar so having that locale makes sense.
| ): AndroidTestConfig = when { | ||
| isInstrumentationTest -> createInstrumentationConfig( | ||
| uploadedApks = uploadedApks, | ||
| testShards = testShards!! |
There was a problem hiding this comment.
IMO we should avoid !! operators. I think we should check and throw an error with detailed info. I know that now we are 100% sure (are we?) that null value will never happen here. But this could be useful during refactor or other changes.
| ) | ||
| isRoboTest -> createRoboConfig( | ||
| uploadedApks = uploadedApks, | ||
| runGcsPath = runGcsPath!! |
Fixes #706
Checklist