Question

I want to integrate the Specs2 test results with Jenkins. I understand that Specs2 will use JUnitXML Listener to generate test results.

I found the below link but didn't understand how to integrate JUnitXML listener to SBT.

http://henkelmann.eu/2010/11/14/sbt_hudson_with_test_integration

I added the below resolver and the dependecy to build.sbt and its downloading.

"Christoph's Maven Repo" at "http://maven.henkelmann.eu/" "eu.henkelmann" % "junit_xml_listener" % "0.2"

But I didn't understand the below instructions(where to add) given in the above link:

//create a listener that writes to the normal output directory def junitXmlListener: TestReportListener = new JUnitXmlTestsListener(outputPath.toString)

//add the new listener to the already configured ones override def testListeners: Seq[TestReportListener] = super.testListeners ++ Seq(junitXmlListener)

Don't forget to import the listener: import eu.henkelmann.sbt.JUnitXmlTestsListener

Kindly help me in integrating the JUnitXML Listener with Spec2.

Best Regards,

Hari

Était-ce utile?

La solution

You don't need the JUnit listener if you just want to generate the JUnit XML file. Just pass junitxml to the arguments:

sbt> testOnly *MySpec* -- console junitxml
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top