为什么声纳会忽略报道?

时间:2013-05-15 15:15:44

标签: python sonarqube

我不明白我在python中的多模块项目发生了什么(只有声纳实验)。 这是声纳日志(不完整):

    .
    ----------------------------------------------------------------------
    Ran 1 test in 0.000s

    OK
    Name                   Stmts   Miss  Cover
    ------------------------------------------
    calculator                 5      1    80%
    test/__init__              1      0   100%
    test/test_calculator       8      0   100%
    ------------------------------------------
    TOTAL                     14      1    93%
    My Other Calculator
    ===================================

    mkdir: cannot create directory `../coverage-reports': File exists
    .
    ----------------------------------------------------------------------
    Ran 1 test in 0.000s

    OK
    Name                    Stmts   Miss  Cover
    -------------------------------------------
    calculator2                 3      0   100%
    test/__init__               1      0   100%
    test/test_calculator2       8      0   100%
    -------------------------------------------
    TOTAL                      12      0   100%

    Executing sonar-runner....

    Sonar Runner 2.2
    Java 1.7.0_09-icedtea Oracle Corporation (64-bit)
    Linux 2.6.32-220.el6.x86_64 amd64
    INFO: Runner configuration file: /home/jenkins/tools/sonar/sonar-runner/conf/sonar-runner.properties
    INFO: Project configuration file: /var/lib/jenkins/jobs/Servidor-RDS/workspace/serv/rdsweb/WebContent/fccma/js/fcc/tests/python-sonar-runner/sonar-project.properties
    INFO: Default locale: "en_US", source code encoding: "UTF-8"
    INFO: Work directory: /var/lib/jenkins/jobs/Servidor-RDS/workspace/serv/rdsweb/WebContent/fccma/js/fcc/tests/python-sonar-runner/.sonar
    INFO: Sonar Server 3.5.1
    ...
    17:07:06.947 INFO  - -------------  Inspecting myCalculator
    17:07:06.954 INFO  - Load module settings
    17:07:07.376 INFO  - Quality profile : [name=Sonar way,language=py]
    17:07:07.405 INFO  - Excluded tests: 
    ....
    17:07:09.347 INFO  - Sensor PythonCoverageSensor...
    17:07:09.348 INFO  - Parsing report '/var/lib/jenkins/jobs/Servidor-RDS/workspace/serv/rdsweb/WebContent/fccma/js/fcc/tests/python-sonar-runner/myCalculator/coverage-reports/coverage_myCalculator.xml'
    ....
    17:07:10.313 INFO  - Execute decorators...
    17:07:11.033 INFO  - -------------  Inspecting myOtherCalculator
    17:07:11.034 INFO  - Load module settings
    17:07:11.117 INFO  - Quality profile : [name=Sonar way,language=py]
    17:07:11.118 INFO  - Excluded tests: 
    ....
    17:07:12.618 INFO  - Sensor PythonCoverageSensor...
    17:07:12.619 INFO  - Parsing report '/var/lib/jenkins/jobs/Servidor-RDS/workspace/serv/rdsweb/WebContent/fccma/js/fcc/tests/python-sonar-runner/myOtherCalculator/coverage-reports/coverage_myOtherCalculator.xml'
   ....
    17:07:13.477 INFO  - -------------  Inspecting My calculator
    17:07:13.478 INFO  - Load module settings
    17:07:13.551 INFO  - Quality profile : [name=Sonar way,language=py]
    17:07:13.553 INFO  - Excluded tests: 
   ....
    17:07:13.654 INFO  - Sensor PythonCoverageSensor...
    17:07:13.654 INFO  - Sensor PythonCoverageSensor done: 0 ms
    ....
    17:07:13.943 INFO  - Execute decorators...
    17:07:14.098 INFO  - Persist graphs of components
    17:07:14.188 INFO  - ANALYSIS SUCCESSFUL, you can browse http://localhost:9000
    ....
    INFO: ------------------------------------------------------------------------
    INFO: EXECUTION SUCCESS
    INFO: ------------------------------------------------------------------------
    Total time: 14.409s
    Final Memory: 14M/643M
    INFO: ------------------------------------------------------------------------

我的问题是服务器中没有显示覆盖信息。每次执行都会显示和更新所有数据,但不会显示覆盖范围。一些想法?

2 个答案:

答案 0 :(得分:0)

您的错误在转储中

mkdir: cannot create directory `../coverage-reports': File exists

尝试在再次运行之前删除../coverage-reports

答案 1 :(得分:0)

PythonCoverageSensor对路径中的大写/小写名称很挑剔。 见http://sonar.15.x6.nabble.com/Python-coverage-information-not-showing-up-in-Sonar-td5005729.html

因此,如果您执行“sonar-runner -X”来检查项目目录中运行器的调试输出,其中“sonar-project.properties”位于其中,您将发现路径中的混合是什么做。

“sonar-runner -X”对所有这些调整非常有用,并且调查Jenkins CI运行Sonar时会发生什么......

干杯! ; - )