1

Im using github action for sonarqube. My project is golang. after build on the sonarqube dashboard code coverage is showing 0.0%. Can you please tell me how to fix the issue.

steps:
    - uses: actions/checkout@master
    - name: SonarQube Scan
      uses: kitabisa/sonarqube-action@master
      with:
        host: http://IPaddress
        login: ${{ secrets.token }}
        projectBaseDir: ./
        projectKey: myprokey
        projectName: mypro
        sonar.sources: .
        #sonar.exclusions: "**/*_test.go"
        sonar.tests: /xxxx/xxxxx/pubsubgossip_test/gossip_test.go

how can i pass argument for the test files which exists in my repo.

2 Answers2

0

May be my question has some answer to you, Integration test code coverage report for Go lang project in SonarQube

You have to perform test, record the test report and coverage report in some file and then make SonarQube digest your report. SonarQube cannot run test, add a step that runs the test.

Here is a sample project and source code so that you can check the whole range of parameters used: https://sonarcloud.io/dashboard?id=io.sonarcloud.examples.go-sqscanner-travis-project https://github.com/SonarSource/sonarcloud_example_go-sqscanner-travis

Shiva
  • 717
  • 9
  • 22
-1

this is how it's configured in my project:

sonar.javascript.file.suffixes=.js,.jsx
sonar.tests=src
sonar.test.inclusions=**/__tests__/**
sonar.sources=src
PANKAJ NAROLA
  • 164
  • 1
  • 10