12

Where does the data that produces the "Test Result Trend" graph actually come from? I have a "Test Only" job that produces 2 files in target/surefire-reports. (Produced by maven) Inspecting the files directly shows that the tests are executing and passing.

The graph shows successful builds along x-axis but no test results. If I click on a specific build from the project page, it shows "(no tests)" next to the "Test Result" link.

Is there some sort of post-processing I need to do on the XML files? They are in JUnit format, produced by the maven-soapui-plugin.

Thanks!

sceaj
  • 1,573
  • 3
  • 12
  • 24
  • Perhaps https://issues.jenkins-ci.org/browse/JENKINS-9980 provides some insight. It seems there are some Jenkins/Maven jobs that don't behave as desired because the "Publish Junit..." option is not available. – sceaj Oct 11 '11 at 19:41

2 Answers2

13

You need to check "Publish JUnit test result report" in the "Post Build Actions" section of your job configuration, and specify the location of the XML output from your JUnit tests.

gareth_bowles
  • 20,760
  • 5
  • 52
  • 82
  • 1
    Unfortunately that option doesn't show up in the job configuration. This may be naive, but it seems that Jenkins already knows that is should publish the results (it shows the test trend graph and provides the "Test Result" link on the build pages), it just doesn't seem to be finding the test output. target/surefire-reports should be the standard location for a maven build. – sceaj Oct 11 '11 at 19:22
  • 2
    The solution was to configure the Jenkins job as a "Freestyle Build" rather than a "Maven 2/3 Build". This allows you to select "Publish JUnit..." and specify the JUnit XML files that are to be aggregated and reported. So in a sense, @gareth_bowles was correct. – sceaj Oct 11 '11 at 20:05
  • I have experienced the same issue. The graph doesn't show when using a Maven in version 3.x. However, I get it with a Maven in version 2.x – jplandrain Jun 27 '12 at 15:32
9

For me, I had this problem when I had the "Aggregate downstream test results" box ticked in the job configuration. Unticking it solved my problem (I can live without aggregate results).

Phil
  • 2,238
  • 2
  • 23
  • 34