Using Gradle 1.7 with Jenkins and when a build fails due to a test failure, the link to the test report is malformed

(scott kuenzli) #1

When using Gradle 1.7 inside a Jenkins CI server, Jenkins emails the Gradle 1.7 console output to report and build failure due to a unit test failure, however the link contained in the console output is malformed. For example, this is what appears in the console/email:


I’m not clear why it’s including the “file://” reference, but I don’t believe that is something Jenkins is adding and would seem to be improperly output by Gradle.

Here’s an example of the Gradle console output shown in the email:

16:04:23.476 [ERROR] [org.gradle.BuildExceptionReporter]
 16:04:23.477 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
16:04:23.477 [ERROR] [org.gradle.BuildExceptionReporter]
 16:04:23.477 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
16:04:23.477 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':unitTest'.
16:04:23.478 [ERROR] [org.gradle.BuildExceptionReporter] > There were failing tests. See the report at: file://<http://my_server:8079/job/my_project/ws/my_project/build/reports/tests/index.html>
16:04:23.479 [ERROR] [org.gradle.BuildExceptionReporter]

(spencer_allain) #2

What does your raw console log for the job look like for this build within Jenkins?


That will let you know for sure whether it is Gradle or Jenkins creating that output.

I rather suspect that jenkins is rewriting the file path in the email as it recognizes that it is a file in the workspace being referenced and it just isn’t checking for “file://” prepending the path.


(scott kuenzli) #3

You’re right, it appears to be a Jenkins issue not interpreting the console output correctly.