Kod Kapsamı için JaCoCo kullanıyorum. Ünite Test raporları, ciha ile oluşturulmakta ve doğru bir şekilde içe aktarılmakta, böylece birim test bilgileri doğru şekilde gösterilmektedir. sorunu, şu hata iletisini alıyorum: Sınama başına kapsam hakkında bilgi yok. ve kod kapsamı, birim testleri, entegrasyon testleri ve genel kapsam için% 0 değerini gösterir. SonarQube 4.5.1
- - SonarRunner 2.4
- MySQL
- junit
: Ben kullanıyorumJaCoCo - SonarQube - Test başına kapsam ile ilgili bilgi yok
Ben vs. ikili, src, testlerin gibi sonar-project.properties gerekli tüm bilgileri kontrol 4.1.1
- jacoco 0.7.2
jacoco.exec, proje ana dizinindeki bir dosyada/hedefte bulunur.
Sonar-project.properties'i görebildiğiniz gibi: Bakış açımdan gerekli tüm yollar düzgün ayarlanmış. (Yani ikili, src, testler)
Comma-separated paths to directories with sources (required)
sonar.sources=src
compiled code
sonar.java.binaries=class
source code of unit tests
sonar.tests=test/src
Comma-separated paths to files with third-party libraries (JAR files in the case of Java)
sonar.java.libraries=jar
Language
sonar.language=java
Encoding of the source files
sonar.sourceEncoding=UTF-8
Additional parameters
sonar.my.property=value
Set Project Base
sonar.projectBaseDir=C:/snapshots/steffen_latest/software/java
Tells SonarQube to reuse existing reports for unit tests execution and coverage reports
sonar.dynamicAnalysis=reuseReports
JUnit path
sonar.surefire.reportsPath=test/report/junit
Tells SonarQube where the unit tests execution reports are
sonar.junit.reportsPath=test/report/junit
Tells SonarQube that the code coverage tool by unit tests is JaCoCo
sonar.java.coveragePlugin=jacoco
Import JaCoCo code coverage report.
Tells SonarQube where the unit tests code coverage report is
Unit Tests Coverage
sonar.jacoco.reportPath=target/jacoco.exec
Tells SonarQube where the integration tests code coverage report is
sonar.jacoco.itReportPath=target/it-jacoco.exec
Bu günlüğü sonar-koşucu gelen dosyasıdır:
13:56:05.883 INFO - Sensor SurefireSensor...
13:56:05.883 INFO - parsing C:\work\snapshots\steffen_latest\software\java\test\report\junit
13:56:06.149 INFO - Sensor SurefireSensor done: 266 ms
13:56:06.149 INFO - Sensor JaCoCoItSensor...
13:56:06.195 INFO - Analysing C:\work\snapshots\steffen_latest\software\java\target\it-jacoco.exec
13:56:06.726 INFO - **No information about coverage per test**.
13:56:06.726 INFO - Sensor JaCoCoItSensor done: 577 ms
13:56:06.726 INFO - Sensor JaCoCoOverallSensor...
13:56:06.851 INFO - Analysing C:\work\snapshots\steffen_latest\software\java\.sonar\jacoco-overall.exec
13:56:07.178 INFO - **No information about coverage per test**.
13:56:07.178 INFO - Sensor JaCoCoOverallSensor done: 452 ms
13:56:07.178 INFO - Sensor JaCoCoSensor...
13:56:07.209 INFO - Analysing C:\work\snapshots\steffen_latest\or_base\software\java\target\jacoco.exec
13:56:07.521 INFO - **No information about coverage per test**.
13:56:07.521 INFO - Sensor JaCoCoSensor done: 343 ms
13:56:07.521 INFO - Sensor CPD Sensor (wrapped)...
13:56:07.521 INFO - JavaCpdEngine is used for java
13:56:07.521 INFO - Cross-project analysis disabled
13:56:09.019 INFO - Sensor CPD Sensor (wrapped) done: 1498 ms
13:56:09.144 INFO - Execute decorators...
13:56:16.166 INFO - Store results in database
kimse bana sorun ne olabilir bir tavsiye verebilir misiniz? Sorunun ne olduğunu bilmediğimden beri ... Birkaç gün içinde bu konu üzerinde çalışıyorum ve gerçekten ne yapacağımı bilmiyorum ..
Önceden teşekkürler.
Test kapsamı, kapsama alanıyla ilgili bilgilerdir. Test başına kapsama hangi testin hangi dosyayı kapsadığı ile ilgili bilgilerdir. (kapsama sadece hangi hatların testlerle kaplandığını bildirir). Bu nedenle, bu sorulara dayanarak lütfen sorunuzu açıklığa kavuşturun, çünkü “Test başına kapsama alanı hakkında hiçbir bilgi yok” mesajı sadece her testte jacoco oturumu yapmak için herhangi bir dinleyici kullanmadığınızı bildirmektedir. – benzonico
İpucu için teşekkürler. Sorun, her testte jacoco oturumu yapmak için herhangi bir dinleyici kullanmadığımız oldu. – Stelos10
Bunu nasıl yapılandırdığınızı kaydetme şansınız var mı? Aynı problemi –