저는 Gradle을 사용하여 음파 탐지기를 통해 코드를 분석해야하며 처리 할 수없는 이상한 문제가 있습니다. 나는 다음과 같은 프로젝트 구조소나가 통합 테스트를 건너 뜁니다
-java
|-src
|-main
|-test
|-integration-test
이 내가/SRC/통합 테스트에 sonar.test 속성을 변경하는 경우 소나는 기본 및 통합 테스트 디렉토리 만 테스트 디렉토리를 분석,하지만 난 함께이 두 개의 디렉토리를 분석 할 나는 그것을 실제로하는 방법을 모른다. 아래에는 gradle.build 파일에서 내 sonarqube 작업 속성이 있습니다.
sonarqube {
properties {
property "sonar.projectName", "projectName"
property "sonar.projectKey", "org.sonarqube:projectName"
property "sonar.host.url", "http://sonar.doesntmetter"
property "sonar.java.coveragePlugin", "jacoco"
property "sonar.junit.reportsPath", "build/test-results/test"
property "sonar.jacoco.reportPath", "build/jacoco/test.exec"
property "sonar.jacoco.itReportPath", "build/jacoco/integrationTest.exec"
property "sonar.login", "admin"
property "sonar.password", "admin"
}
}
내가 눈치 것은 내가 Gradle을 빌드를 실행할 때 integrationTest.exec와의/구축/jacoco/디렉토리 test.exec,하지만 난 재산 sonar.test 기본적으로 Gradle을 sonarqube을 실행할 경우이 것이있을 것 test.exec 만하고 다른 손에서 sonar.test =/src/integration-test로 gradle sonarqube를 실행하면 test.exec와 integrationTest.exec가 모두 존재하게됩니다.
단위 및 통합 테스트를 한 번에 분석하는 방법을 모르십니까?
불행히도 도움이되지 않습니다. 단위 테스트에 대한 통계 만 있습니다. –
보고서가 누락되었지만 테스트가 실행되었습니다. 그럼 당신은 reportPath에 대한 속성을 더 추가해야합니다 :'sonar.surefire.reportsPath' 'sonar.junit.reportsPath' – Hrabosch
실제로 통합 테스트가 실행되지 않습니다 –