Add more sdlgo source code files to be part of the coverage measurement.
Exclude also some files what shouldn't be visible in coverage report,
like example, mock and testing files.
Issue-Id: RIC-887
Signed-off-by: Timo Tietavainen <timo.tietavainen@nokia.com>
Change-Id: Iffea947e55a16306271f0f6dbeb967d3b1bd1cae
# Build
-go build -a -installsuffix cgo -ldflags "-X main.Version=$tag -X main.Hash=$hash" -o ./cmd/*.go
+go build ./...
# Execute UT and measure coverage
-go test . -v -coverprofile cover.out || true
+go test ./... -v -coverprofile cover.out || true
echo "--> build_sdlgo_ubuntu.sh ends"
# Source
sonar.sources=.
# Unit tests
- sonar.go.coverage.reportPaths=./cover.out,/internal/sdlgoredis/cover.out
+ sonar.go.coverage.reportPaths=**/cover.out
# Inclusions
sonar.inclusions=**/*.go
# Exclusions
- sonar.exclusions=**/*_test.go
+ sonar.exclusions=cmd/**.go,example/**.go,internal/mocks/**.go,**/*_test.go
jobs:
- gerrit-sonar-prescan-script