android - gcloud CLI:如何使用 clearPackageData 参数运行仪器测试?
问题描述
我正在使用带有标志的gcloud firebase test android run命令运行我的测试,--use-orchestrator
以启用 Android Test Orchestrator。有一个 Orchestrator 参数clearPackageData
可以在测试之间清除应用程序的状态,我可以在我自己的设备上从 Android Studio 运行测试时使用它:
android {
defaultConfig {
...
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// The following argument makes the Android Test Orchestrator run its
// "pm clear" command after each test invocation. This command ensures
// that the app's state is completely cleared between tests.
testInstrumentationRunnerArguments clearPackageData: 'true'
}
testOptions {
execution 'ANDROID_TEST_ORCHESTRATOR'
}
}
dependencies {
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestUtil 'com.android.support.test:orchestrator:1.0.2'
}
但是,当使用上面提到的命令和标志在 Firebase 测试实验室中运行测试时,此参数设置为false
. 有没有办法将此参数设置为true
?
解决方案
在 gcloud 命令行上使用它:
--environment-variables clearPackageData=true
推荐阅读
- c++ - 删除动态数组后,其边界的某些值不会改变。为什么?
- python - 无法选择网站上的搜索栏并输入密钥而未收到 typeError
- excel - 如何正确比较两个值?
- spring - 春季启动期间JpaTransactionManager崩溃而没有错误
- django - 注释 FK 的 FK 计数
- sql-server - 当我尝试同时使用 CAST 和 CASE 时,它说错误
- c++ - std::tuple_cat 但仅具有唯一元素
- python-3.x - 使用 CSV 模块从一行中间删除 CRLF
- haskell - 如何在 Rust 中复制 Haskell 的 `scanl (+) 0 xs`?
- google-analytics - 在 localhost 上运行时 Google Optimize 未触发