ted
ted

Reputation: 4975

Add logging to tests results in jenkins

I am using nose in jenkins to test a project. If a test fails, I get a short report of the output to the console. I would like to have this output regardless of the test result. So even if the test passes I want to be able to see the tests output to stderr/stdout.

At the moment I can turn off logging by calling nose with --nocapture. However this results in all the output beeing under the projects console log that jenkins creates by default. How I tell nose/capture to append the captured output to each test result shown in Jenkins? I use xunit to generate a junit compatible xml file which is in turn used by Jenkins to generate its reports.

edit: Additional Infos as requested

Url in Jenkins (after buildnumber part):

/testReport/testDesignParser.testDesignCsvParser.testDesignCsvParser/testDesignCsvParser/test/?

I know that this design is not pretty but thats how it is now. If it matters:

`testDesignParser.testDesignCsvParser.testDesignCsvParser` module  
`testDesignCsvParser`                                      class  
`test`                                                     (member)testfunction

Upvotes: 2

Views: 4083

Answers (2)

ted
ted

Reputation: 4975

With the latest Jenkins there is an option to save the output (Retain long standard output/error) right under the post build step belonging to JUnit. Additionally I run nose with --nocapture. This gives me a console output view on every test (an option on the left menu when I have a test opened)

Upvotes: 2

Aaron Digulla
Aaron Digulla

Reputation: 328594

There is no way to achieve this from your tests. The report generator simply won't display the output unless there are errors.

You will have to get the sources for Jenkins itself (the JUnit runner is built into it) and patch the reporter or write your own plugin.

Upvotes: 1

Related Questions