diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 215b31e..8714f0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,8 @@ jobs: echo "DB_TYPE=\"sqlite3\"" >> .env.test - name: Run tests - run: go test ./... -v -coverpkg=./... -coverprofile=coverage.out + run: | + go test "./..." -coverprofile="coverage.out" -covermode=count -json > test-report.json - name: Delete the .env.test file after tests are completed run: rm .env.test diff --git a/.gitignore b/.gitignore index 6b846c5..10bbcdc 100644 --- a/.gitignore +++ b/.gitignore @@ -12,8 +12,9 @@ csb # Test binaries. *.test -# Go coverage output. +# Go test and coverage output. *.out +test-report.json # env file. .env diff --git a/sonar-project.properties b/sonar-project.properties index 072116d..8a913ad 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -9,4 +9,5 @@ sonar.tests=. sonar.test.inclusions=**/*_test.go sonar.test.exclusions=**/vendor/** +sonar.go.tests.reportPaths=test-report.json sonar.go.coverage.reportPaths=coverage.out