Android的Test Orchestrator正在崩溃的测试中停止

时间:2018-12-01 02:39:00

标签: android

我最近发现了适用于Android的测试协调器,它应该可以让我通过隔离测试来更加稳定地运行测试。我在此找到的文档在这里(https://developer.android.com/training/testing/junit-runner#ato-command-line)。

根据我对文档的理解,它说即使测试失败,它仍将继续。

“崩溃是隔离的。即使一个测试崩溃,它也只会删除其自己的Instrumentation实例,因此套件中的其他测试仍然可以运行。”

但是,当我运行测试协调器时,我注意到当测试崩溃时,它会确实关闭整个测试。这是我在屏幕上看到的输出。

Process crashed while executing <test> 

<stack trace here>

INSTRUMENTATION_RESULT: shortMsg=Process crashed.
INSTRUMENTATION_CODE: 0

我正在按以下方式进行测试(摘自上述文档)。

# Install the test orchestrator.
adb install -r path/to/m2repository/com/androidx/test/orchestrator/1.1.0/orchestrator-1.1.0.apk

# Install test services.
adb install -r path/to/m2repository/com/androidx/test/services/test-services/1.1.0/test-services-1.1.0.apk

adb shell 'CLASSPATH=$(pm path androidx.test.services) app_process / androidx.test.services.shellexecutor.ShellMain am instrument -w -e -v targetInstrumentation com.example.test/androidx.test.runner.AndroidJUnitRunner androidx.test.orchestrator/.AndroidXTestOrchestrator'

是否需要设置一个特定的标志才能告诉测试协调器继续?

0 个答案:

没有答案