Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
SonarQube => 9.1
Scanner => SonarScanner 4.6.2.2472 - what are you trying to achieve
Trying to import coverage.out file in sonarqube still getting 0% in overall coverage - what have you tried so far to achieve this
pipeline script
${scannerHome}/bin/sonar-scanner \
-Dsonar.projectKey=freshdesk_collab \
-Dsonar.sources=. \
-Dsonar.host.url=https://quality.***.com \
-Dsonar.login=*** \
-Dsonar.sourceEncoding=UTF-8 \
-Dsonar.exclusions=**/vendor/**,**/src/**/*.html,**/client/** \
-Dsonar.go.coverage.reportPaths=$WORKSPACE/server/src/coverage.out
'''
log
INFO: Sensor Go Cover sensor for Go coverage [go]
INFO: Load coverage report from '/home/jenkins/workspace/SonarQube-freshconnect-collab-golang/server/src/coverage.out'
WARN: File '/server/src/model/message.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/payload.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/message_metadata.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/conversation.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/user_preference.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/message_receipt.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/account_channel.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/product.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/conversation_channel.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/product_context.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/thread_member.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/product_account.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/yp_fw_account_user.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/product_user.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/yp_account.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/yp_user.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/user.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/yp_user_realm.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/yp_fw_account.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/account.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/mapping.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/thread.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/conversation_member.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/user_channel.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/yp_account_realm.go' is not included in the project, ignoring coverage
WARN: File '/server/src/model/yp_realm.go' is not included in the project, ignoring coverage
INFO: Sensor Go Cover sensor for Go coverage [go] (done) | time=48ms
I’ve also run the native go tool to verify the coverage.out
go tool cover -func="coverage.out"
coresponding logs
...
model/yp_user_realm.go:410: GetYpUserRealmsByYpAccIDAndYpAccRealmIDAndYpUserIDs 60.0%
model/yp_user_realm.go:433: GetYpUserRealmsByYpAccIDAndFwUid 60.0%
model/yp_user_realm.go:456: DeleteYpUserRealmByYpAccIDAndYpAccRealmIDAndYpUserID 57.7%
model/yp_user_realm.go:514: UpdateYpUserRealm 51.6%
model/yp_user_realm.go:587: DeleteYpUserRealmsByYpAccID 66.7%
model/yp_user_realm.go:606: InsertIntoSearchService 55.6%
total: (statements) 53.5%