Gradle build for Android 中的 JUnit 测试结果在哪里?

Where's JUnit test results located in Gradle build for Android?

我正在尝试通过 jenkins 进行持续集成。 我现在正在发布测试结果部分并且有点挣扎。

Recording test results ERROR: Publisher hudson.tasks.junit.JUnitResultArchiver aborted due to exception hudson.AbortException: No test report files were found. Configuration error? at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:116) at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:92) at hudson.FilePath.act(FilePath.java:981) at hudson.FilePath.act(FilePath.java:959) at hudson.tasks.junit.JUnitParser.parseResult(JUnitParser.java:89) at hudson.tasks.junit.JUnitResultArchiver.parse(JUnitResultArchiver.java:121) at hudson.tasks.junit.JUnitResultArchiver.perform(JUnitResultArchiver.java:138) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:74) at hudson.tasks.BuildStepMonitor.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683) at hudson.model.Run.execute(Run.java:1784) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240)

说找不到任何测试结果

这是我在 jenkins 中设置的路径:

我只是按照这里所说的去做了Gradle Plugin User Guide

All test results are stored as XML files under build/androidTest-results

那么真正的路径是什么?谢谢!

自那篇文章撰写以来,测试报告路径已更改。现在您会在 <module-name>/build/outputs/reports/androidTests 目录中找到您的报告。默认情况下 Android Studio 将创建名称为 app 的模块。在这种情况下,您报告的路径将为 app/build/outputs/reports/androidTests.