W
W
wrath2011-06-21 14:47:33
Software testing
wrath, 2011-06-21 14:47:33

Generating reports on build results in Hudson from a Junit XML format xml file

Greetings!

For automated testing of a web project, the following bundle is set up Hudson + PHPUnit + Selenium . Build results are written in Junit xml format . Unfortunately, when trying to enable the generation of html reports using the Hudson Publish JUnit test result report feature, the build ends with a Failed result. In Hudson, the test launch configuration looks like this. We enable report generation through the option “Publish JUnit test result report” , and in the “XML files with test reports” field, specify the path to the folder where the tests are located.


...
sudo -u apache phpunit --log-junit /var/lib/hudson/jobs/Work-stars-Tests/builds/${BUILD_ID}/seleniumReports/seleniumTests.xml + путь к тестовым файлам php
...





The user launching Hudson has the rights to read files in the folder with reports, they tried to specify the full and relative path to it.

As a result, we still get an error in the console No test report files were found. configuration error?

Has anyone encountered a similar problem would greatly appreciate the help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
wrath, 2011-06-23
@wrath

I found a solution to the problem myself, I decided to share :)
In the Hudson project settings, I changed the Run shell script field in this way and set the following path to the files with reports
> #!/bin/sh -x phpunit --log-junit ${WORKSPACE}/zf/tests/_tmp/reports/seleniumTests.xml
${WORKSPACE}/zf/tests/selenium/; sed
-i '//D;/^ <\/testsuite>$/D'
${WORKSPACE}/zf/tests/_tmp/reports/seleniumTests.xml

**/zf/tests/_tmp/reports/*.xml

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question