Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "Test reports were found but none of them are new. Did tests run?" in Jenkins

I am getting the error "Test reports were found but none of them are new. Did tests run?" when trying to send unit test results by email. The reason is that I have a dedicated Jenkins job that imports the artifacts from a test job to itself, and sends the test results by email. The reason why I am doing this is because I don't want Jenkins to send all the developers email during the night :) so I am "post-poning" the email sending since Jenkins itself does not support delayed email notifications (sadly).

However, by the time the "send test results by email" job executes, the tests are hours old and I get the error as specified in the question title. Any ideas on how to get around this problem?

like image 289
user1340582 Avatar asked Dec 14 '12 13:12

user1340582


3 Answers

You could try updating the timestamps of the test reports as a build step ("Execute shell script"). E.g.

cd path/to/test/reports
touch *.xml
like image 142
Armand Avatar answered Oct 28 '22 13:10

Armand


mvn clean test 

via terminal or jenkins. This generates new tests reports.

The other answer that says cd path/to/test/reports touch *.xml didn't work for me, but mvn clean test yes.

like image 9
alansastre Avatar answered Oct 28 '22 12:10

alansastre


Updating the last modified date can also be achieved in gradle itself is desired:

task jenkinsTest{
    inputs.files test.outputs.files
    doLast{
        def timestamp = System.currentTimeMillis()
        test.testResultsDir.eachFile { it.lastModified = timestamp }
    }
}

build.dependsOn(jenkinsTest)

As mentioned here: http://www.practicalgradle.org/blog/2011/06/incremental-tests-with-jenkins/

like image 8
Moritz Avatar answered Oct 28 '22 11:10

Moritz