以下のコマンドを使用して、自分のビルドコードをビルドします。ユニットと統合テストをソナーコードカバレッジに含める方法
、コンパイル
-DargLine="-DDB_SERVER=localhost -DDB_PORT=5432 -DDB_NAME=sample -DDB_USER=sample -DDB_PASSWORD=sample -DDB_MAX_POOL=10" -Dcom.sample.redis=false clean compiler:compile
単体テスト解析 -
DargLine=-DDB_SERVER=localhost -DDB_PORT=1234 -DDB_NAME=sample -DDB_USER=sample -DDB_PASSWORD=sample -DDB_MAX_POOL=10 -Dcom.sample.redis=false -Dcobertura:cobertura-integration-test -Dcobertura.aggregate=false -Dcobertura.report.format=xml integration-test test
ソナーで公開するXMLをキャプチャするためにソナーのプロパティの下に使用しました。
sonar.projectKey=sample
sonar.projectName=sample
sonar.projectVersion=$PipelineId
sonar.modules=admin,client-api,common,om,serviceproviders
sonar.cobertura.reportPath=target/site/cobertura/coverage.xml
sonar.sources=.
sonar.skipPackageDesign=true
sonar.sourceEncoding=UTF-8
マルチモジュールのため、コードカバレッジはわずか9.4%にすぎません。私は何かが欠けている。エラーログも表示されません.Jacocoのようなカバレッジツールを使用して同じように達成できますか。
SonarQube - Version 5.1.1 - LGPL v3
現在のバージョンは6.4で、現在のLTSは5.6.6です。あなたはバージョン<それらのための多くの助けを見つける可能性はありません。 –