Jenkins PHP工作失败了

时间:2014-12-16 12:12:38

标签: php ant jenkins phpunit xunit

与詹金斯搏斗的几天和给我的错误。现在我的东西有些稳定,但我无法理解,因为构建失败了。这就是我的收入,我无法弄清楚我错在哪里。

考虑以下两个主题: Jenkins PHP Job FailingJenkins-Job fails

但我找不到解决问题的方法。

[workspace] $ ant

Buildfile: /var/lib/jenkins/jobs/MTR-CMS/workspace/build.xml

clean:
   [delete] Deleting directory /var/lib/jenkins/jobs/MTR-CMS/workspace/build/coverage
   [delete] Deleting directory /var/lib/jenkins/jobs/MTR-CMS/workspace/build/logs

prepare:
    [mkdir] Created dir: /var/lib/jenkins/jobs/MTR-CMS/workspace/build/coverage
    [mkdir] Created dir: /var/lib/jenkins/jobs/MTR-CMS/workspace/build/logs

phpunit:
     [exec] PHPUnit 4.4.0 by Sebastian Bergmann.
     [exec] 
     [exec] Configuration read from /var/lib/jenkins/jobs/MTR-CMS/workspace/phpunit.xml
     [exec] 
     [exec] .
     [exec] 
     [exec] Time: 154 ms, Memory: 10.00Mb
     [exec] 
     [exec] OK (1 test, 1 assertion)
     [exec] 
     [exec] Generating code coverage report in Clover XML format ... done
     [exec] 
     [exec] Generating code coverage report in HTML format ... done

build:

BUILD SUCCESSFUL
Total time: 1 second
Publishing Clover coverage report...
Publishing Clover HTML report...
Publishing Clover XML report...
Publishing Clover coverage results...
[CRAP4J] Collecting Crap4J analysis files...
[CRAP4J] Searching for report files within build/logs/crap4j.xml
[CRAP4J] Using the new FileSetBuilder
[CRAP4J] No crap4j report files were found. Configuration error?
Build step 'Report Crap' changed build result to FAILURE
Build step 'Report Crap' marked build as failure
[xUnit] [INFO] - Starting to record.
[xUnit] [INFO] - Processing PHPUnit-3.x (default)
[xUnit] [INFO] - [PHPUnit-3.x (default)] - No test report file(s) were found with the pattern 'build/logs/junit.xml' relative to '/var/lib/jenkins/jobs/MTR-CMS/workspace' for the testing framework 'PHPUnit-3.x (default)'.  Did you enter a pattern relative to the correct directory?  Did you generate the result report(s) for 'PHPUnit-3.x (default)'?
[xUnit] [ERROR] - No test reports found for the metric 'PHPUnit' with the resolved pattern 'build/logs/junit.xml'. Configuration error?.
[xUnit] [INFO] - Failing BUILD.
[xUnit] [INFO] - There are errors when processing test results.
[xUnit] [INFO] - Skipping tests recording.
[xUnit] [INFO] - Stop build.
Finished: FAILURE

2 个答案:

答案 0 :(得分:2)

请检查您的构建文件

您的构建配置文件无法创建' junit.xml'档案

检查phpunit.xml文件

<logging>
    <log type="coverage-html" target="coverage"/>
    <log type="coverage-clover" target="clover/clover.xml"/>
    <log type="coverage-crap4j" target="logs/crap4j.xml"/>
    <log type="junit" target="logs/junit.xml" logIncompleteSkipped="false"/>
</logging>

答案 1 :(得分:-1)

有什么不清楚的?

[CRAP4J] Collecting Crap4J analysis files...
[CRAP4J] Searching for report files within build/logs/crap4j.xml
[CRAP4J] Using the new FileSetBuilder
[CRAP4J] No crap4j report files were found. Configuration error?
Build step 'Report Crap' changed build result to FAILURE
Build step 'Report Crap' marked build as failure`

您的Crap4J plugin正在将构建结果设置为失败。

它还说它无法找到报告文件,因此您的构建不会产生插件所需的.xml,或者您没有指定这些文件的位置