Go Lang的Sonarqube中未出现代码覆盖 [英] code coverage is not happening in sonarqube for go lang

查看:14
本文介绍了Go Lang的Sonarqube中未出现代码覆盖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在对Sonarqube使用GitHub操作。我的项目是高朗。在Sonarqube仪表板上构建后,代码覆盖率显示为0.0%。您能告诉我如何解决这个问题吗?

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

如何为我的Repo中存在的测试文件传递参数。

推荐答案

我的问题可能对您有一些答案, Integration test code coverage report for Go lang project in SonarQube

您必须执行测试,将测试报告和覆盖率报告记录在某个文件中,然后让SonarQube对您的报告进行摘要。SonarQube无法运行测试,请添加运行测试的步骤。

以下是一个示例项目和源代码,您可以查看所使用的所有参数: https://sonarcloud.io/dashboard?id=io.sonarcloud.examples.go-sqscanner-travis-project https://github.com/SonarSource/sonarcloud_example_go-sqscanner-travis

这篇关于Go Lang的Sonarqube中未出现代码覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆