gpt4 book ai didi

android - SonarQube 5.6没有显示Android项目的testcoverage报告

转载 作者:行者123 更新时间:2023-12-03 04:31:51 25 4
gpt4 key购买 nike

我试图将Sonarqube与我在Android Studio上的android项目集成
我设置了以下声纳属性

sonarqube {
properties {
property "sonar.sources", "src/main"
property "sonar.test", "src/test"
property "sonar.java.coveragePlugin", "jacoco"
property "sonar.jacoco.reportPath", "$buildDir/jacoco/testDebugUnitTest.exec"
property "sonar.junit.reportsPath", "$buildDir/test-results/debug/"
property "sonar.language", "java"
property "sonar.sourceEncoding", "UTF-8"
property "sonar.exclusions", "**/R.java,**/R\$*.java,src/main/gen/**/*"
property "sonar.projectKey", "My project package"
property "sonar.projectName", "Project Name "
property "sonar.java.binaries", "$buildDir/intermediates/classes/debug/"
property "sonar.java.test.binaries", "$buildDir/intermediates/classes/test/debug/"
property "sonar.surefire.reportsPath", "$buildDir/test-results/debug"
}}

Jacoco报告正在合并* .exec文件,但是我收到以下警告 following warning

但是,测试用例正在通过,并且生成了test file.xml的TEST名称,但仍然无法获得声纳的测试范围。

请帮助我摆脱这个..!

最佳答案

找到了解决方案!

我的app / build.gradle:

sonarqube {
properties {
property "sonar.language", "java"
property "sonar.projectKey", "testbluetooth"
property "sonar.projectName", "testbluetooth"
property "sonar.projectVersion", android.defaultConfig.versionName
property "sonar.sources", "src/main/java"
property "sonar.java.binaries", "build/intermediates/classes/debug"
property "sonar.test", "src/testDebug/java"
property "sonar.junit.reportsPath", "build/test-results/debug/"
property "sonar.java.coveragePlugin", "jacoco"
property "sonar.jacoco.reportPath", "build/jacoco/testDebugUnitTest.exec"
property "sonar.android.lint.report", "build/outputs/lint-results-debug.xml"
}
}

我所有的测试都在“src / testDebug /”中!

关于android - SonarQube 5.6没有显示Android项目的testcoverage报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37791049/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com