Skip to content

Commit

Permalink
fix(ci): Add a test report as well, hopefully fixing the issue where …
Browse files Browse the repository at this point in the history
…coverage shows 0%
  • Loading branch information
Dobefu committed Dec 20, 2024
1 parent 8bd0812 commit d78dd18
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ csb
# Test binaries.
*.test

# Go coverage output.
# Go test and coverage output.
*.out
test-report.json

# env file.
.env
Expand Down
1 change: 1 addition & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d78dd18

Please sign in to comment.