1

我不明白我在 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: ------------------------------------------------------------------------

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

4

2 回答 2

0

您的错误在您的转储中

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

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

于 2013-05-15T16:27:05.940 回答
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 时发生的情况非常有用......

干杯! ;-)

于 2013-07-17T09:07:19.157 回答