2

We use Hudson as our CI tool. And i wanted to configure a hudson job to send the test report for failed tests for maven based project. (configuring mail subject for Unstable builds in editable email configuration section)

I used the template as suggested in http://techkriti.wordpress.com/2008/08/30/using-groovy-with-hudson-to-send-rich-text-email/

But the links to test cases aren't working as the required link contains groupId$artifactId of the particular module corresponding to that test case

Required link : job-url/groupId$artifactId/build-number/testReport/package-name/classname.testname/

But the link which we get using the following format is : job-url/build-number/testReport/package-name/classname.testname/

Used format : $HUDSON_URL/job/$PROJECT_NAME/$BUILD_NUMBER/testReport/$packageName/$className/$testName

Any idea how to access groupId and artifactId from the script ?

Thanks,
Gayathri

Igor
  • 33,276
  • 14
  • 79
  • 112
crankparty
  • 1,230
  • 3
  • 17
  • 26

1 Answers1

1

Modify the variable url in the script as follows:

def testResultVar = new hudson.tasks.test.SimpleCaseResult()
def url = tr.getRelativePathFrom(testResultVar)

(getRelativePathFrom method returns absolute path to the test result if the argument is not in its tree)

This workaround solves the issue.

Thanks,
Gayathri

crankparty
  • 1,230
  • 3
  • 17
  • 26