Skip to content

Commit

Permalink
+ add coverage report to sonarcloud (0xPolygonHermez#2706)
Browse files Browse the repository at this point in the history
* + add coverge to sonarcloud
  • Loading branch information
joanestebanr authored Oct 25, 2023
1 parent 0a9be06 commit 3a4aa63
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,27 @@ on:
push:
branches:
- develop
- feature/sonarcloud-coverage

jobs:
sonarqube:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
# Disabling shallow clone is recommended for improving relevancy of reporting.
fetch-depth: 0

- name: Compile SCs
run: make compile-scs
working-directory: test

- name: Test
env:
ZKPROVER_URI: 127.0.0.1
run: make test-full-non-e2e
working-directory: test

# Triggering SonarQube analysis as results of it are required by Quality Gate check.
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
Expand Down
4 changes: 3 additions & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ sonar.projectKey=zkevm-node

sonar.sources=.
sonar.exclusions=**/*_test.go
sonar.exclusions=**/mock_*.go

sonar.tests=.
sonar.test.inclusions=**/*_test.go
sonar.test.exclusions=./ci/**, ./test/e2e/**
sonar.go.coverage.reportPaths=coverage.out
sonar.go.tests.reportPaths=report.json
2 changes: 1 addition & 1 deletion test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ test-full-non-e2e: stop ## Runs non-e2e tests checking race conditions
$(RUNL1NETWORK)
sleep 15
docker logs $(DOCKERCOMPOSEZKPROVER)
trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -short -race -p 1 -timeout 60s ../...
trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -short -race -p 1 -covermode=atomic -coverprofile=../coverage.out -timeout 70s ../...

.PHONY: test-e2e-group-1
test-e2e-group-1: stop ## Runs group 1 e2e tests checking race conditions
Expand Down

0 comments on commit 3a4aa63

Please sign in to comment.