2

I know how to run tests via a Jenkins job and how to output custom XML results in JUnit specification which are then loaded/visualized by a post-build step to get this nice fancy trend graph.

Now I have a lot of these simple testresults xmls, that are old. They are also produced by a different process, not a Jenkins job. I only want to use Jenkins to visualize them and get the graphical representation. From here I know that Jenkins is hardcoded to reject xml files that are older than 1000ms: http://comments.gmane.org/gmane.comp.java.hudson.user/30138

It will then tell me this: "Test reports were found but none of them are new. Did tests run?"

However, is there no way to do it? Never thought this would be a problem.

Cheers

EDIT: Cool idea, thank you. I am on windows but did a 'touch' equivalent like so:

import os

for f in files:
    # 'touch' equivalent like in unix
    temp = open(f, "w")
    temp.write("")
    temp.close()

Jenkins shows me the graph now, however instead of interpreting the XMLs content, it just tells me that I have 350 failures (since I have 350 test result log files) and this error message for each failure:

"Stacktrace

Test report file C:\Documents and Settings\myUsername.jenkins\jobs\testjob\test-reports\TEST-TestScript-20130528125706.xml was length 0"

What does that have to mean ...

br0t
  • 37
  • 2
  • 7
  • Possible duplicate of [Read file from Jenkins workspace with System groovy script](http://stackoverflow.com/questions/23636436/read-file-from-jenkins-workspace-with-system-groovy-script) – Paul Sweatte Dec 15 '16 at 21:55

1 Answers1

1

How about having a build step that performs a 'touch' on the files?

tdrury
  • 2,307
  • 1
  • 22
  • 25