Sonar(Python)代码的报告中没有显示覆盖范围

时间:2018-02-16 19:37:27

标签: python maven sonarqube code-coverage

我目前正在努力让覆盖范围显示,

在指定的target目录上正确生成覆盖文件(cobertura xml),然后在sonar.python.coverage.reportPath(基于我的父pom文件)上指定它。顶级是父pom和不同的目录(包)。

这就是module-test pom的pom属性的样子

<sonar.inclusions>**/python/*/*.py</sonar.inclusions>
<sonar.exclusions>**/python/*/__init__.py</sonar.exclusions>
<sonar.language>py</sonar.language>
<sonar.python.coverage.reportPath>target/cov-report/cov-report.xml</sonar.python.coverage.reportPath>

可能是因为夹杂物会阻止它被添加吗? 我目前设置它,以便声纳只分析我们的基本文件。

这是项目结构:

module-a
    src
        python
    target  
module-b
    src
       python
    target  
module-c
    src
       python
    target  
module-test
    src
       python
           functionA
           functionB
       unit_test.py
    target
        cov-report
            cov-report.xml
    pom.xml
pom.xml


[WARNING] JUnit report directory not found at 
/home/jenkins/workspace/master-ASDASKDOKAOK/module-test/sonar-reports
[INFO] Sensor Swift Surefire Sensor (done) | time=0ms
[INFO] Sensor SCM Sensor
[INFO] Sensor SCM Sensor (done) | time=1ms
[INFO] Sensor Python Squid Sensor
[INFO] Python unit test coverage
[INFO] Parsing report '/home/jenkins/workspace/master-ASDASKDOKAOK/module-test/target/cov-report/cov-report.xml'
[INFO] Python integration test coverage
[INFO] Python overall test coverage
[INFO] Sensor Python Squid Sensor (done) | time=1311ms
[INFO] Sensor XmlFileSensor
[INFO] Sensor XmlFileSensor (done) | time=0ms
[INFO] Sensor Analyzer for "php.ini" files
[INFO] Sensor Analyzer for "php.ini" files (done) | time=0ms
[INFO] Sensor Zero Coverage Sensor
[INFO] Sensor Zero Coverage Sensor (done) | time=9ms
[INFO] Sensor Code Colorizer Sensor
[INFO] Sensor Code Colorizer Sensor (done) | time=0ms
[INFO] Sensor CPD Block Indexer
[INFO] DefaultCpdBlockIndexer is used for py
[INFO] Sensor CPD Block Indexer (done) | time=52ms

声纳版本是sonar-python-plugin-1.8.0.1496

0 个答案:

没有答案