【问题标题】:Run testSuite using command line android studio and generate code coverage report使用命令行 android studio 运行 testSuite 并生成代码覆盖率报告
【发布时间】:2021-09-27 12:04:11
【问题描述】:

我有 4 套测试服(每套测试),每套针对特定类型的用户。我正在尝试获取其中之一的代码覆盖率。当我运行测试套件时,没有生成代码覆盖率报告。

所以我尝试从命令行运行测试(如下所示),但这是运行所有测试套件中的所有测试,因此测试失败并且不生成代码覆盖率报告。谁能帮助我如何生成代码覆盖率报告?我使用 -Dtest.single 和 --tests 来指定要获取覆盖率报告的测试套件,但没有运气:(

gradlew createDebugCoverageReport -Pandroid.testInstrumentationRunnerArguments.USERNAME=<username> -Pandroid.testInstrumentationRunnerArguments.PASSWORD=<password>

【问题讨论】:

    标签: android-studio gradle command-line code-coverage test-suite


    【解决方案1】:

    可以使用 gcloud 命令执行此操作。在命令末尾添加以下内容--test-targets="class com.example.package.testsuite"

    【讨论】:

      猜你喜欢
      • 2021-06-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-26
      • 1970-01-01
      • 2020-05-20
      • 2011-03-09
      相关资源
      最近更新 更多