From what i read from these docs we can annotate any flakytests and then there should be a way to filter them out and run them alone.I was thinking firebase robo tests will know about this and re -tests the flaky ones only, but the following statements have confused me :
Can then be used to filter tests on execution using -e annotation or -e notAnnotation as desired.
What is this switch -e ? How can i filter tests ? the comment leads me to confusion on how to fitler tests on execution. is it done on the gradle command line ? Can i get an example ?
答案 0 :(得分:0)
在这里输入代码我终于找到了如何做到这一点。在测试方法上添加注释时,可以运行一组具有相同注释的方法。阅读the docs我们会发现如何做到这一点。所以,如果我将许多测试标记为@FlakyTest,那么我可以使用这样的adb运行所有FlakyTest:
adb shell am instrument -w -e annotation android.support.test.filters.FlakyTest
这是AndroidJUnitRunner文档的一部分,解释了这一点:
使用给定注释过滤测试运行到测试:adb shell am instrument -w -e annotation com.android.foo.MyAnnotation com.android.foo/android.support.test.runner.AndroidJUnitRunner