Skip to content

Commit e22b711

Browse files
committed
fix sonar not finding erigon-lib coverage
1 parent 54a3134 commit e22b711

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ go.work*
7878
docker-compose.*.yml
7979
.env
8080
coverage.out
81-
coverage-erigon.out
82-
coverage-erigon-lib.out
81+
coverage-total.out
8382

8483
dist
8584
__debug_bin

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ test-erigon-ext:
162162

163163
## test: run unit tests with a 100s timeout
164164
test: test-erigon-lib
165-
$(GOTEST) --timeout 10m -coverprofile=coverage-erigon.out
165+
$(GOTEST) --timeout 10m -coverprofile=coverage.out
166166

167167
test3: test-erigon-lib
168168
$(GOTEST) --timeout 10m -tags $(BUILD_TAGS),e3
@@ -313,7 +313,7 @@ user_macos:
313313
## coverage: run code coverage report and output total coverage %
314314
.PHONY: coverage
315315
coverage:
316-
@go test -coverprofile=coverage.out ./... > /dev/null 2>&1 && go tool cover -func coverage.out | grep total | awk '{print substr($$3, 1, length($$3)-1)}'
316+
@go test -coverprofile=coverage-total.out ./... > /dev/null 2>&1 && go tool cover -func coverage-total.out | grep total | awk '{print substr($$3, 1, length($$3)-1)}'
317317

318318
## hive: run hive test suite locally using docker e.g. OUTPUT_DIR=~/results/hive SIM=ethereum/engine make hive
319319
.PHONY: hive

erigon-lib/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,5 @@ libmdbx/build/*
7373
tests/testdata/*
7474

7575
go.work*
76+
77+
coverage.out

erigon-lib/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ lint-deps: lintci-deps lint-licenses-deps
9797
lint: lintci lint-licenses lint-mod-tidy
9898

9999
test:
100-
$(GOTEST) --count 1 -p 2 -coverprofile=coverage-erigon-lib.out ./...
100+
$(GOTEST) --count 1 -p 2 -coverprofile=coverage.out ./...
101101

102102
test-no-fuzz:
103103
$(GOTEST_NOFUZZ) --count 1 -p 2 ./...

sonar-project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sonar.exclusions=**/*.pb.go,**/gen_*.go,**/graphql/graph/generated.go,**/*.sol,c
88
sonar.tests=.
99
sonar.test.inclusions=**/*_test.go,tests/**
1010

11-
sonar.go.coverage.reportPaths=coverage-erigon.out,coverage-erigon-lib.out
11+
sonar.go.coverage.reportPaths=coverage.out,erigon-lib/coverage.out
1212

1313
# The only way to get an accurate analysis of C/C++/Objective-C files is
1414
# by using the SonarSource build-wrapper and setting the property "sonar.cfamily.build-wrapper-output"

0 commit comments

Comments
 (0)