I want to integrate Specs2 test results with Jenkins.
I added the following properties to sbt:
recognizer:
"maven specs2" at "http://mvnrepository.com/artifact"
libraryDependencies:
"org.specs2" %% "specs2" % "2.0-RC1" % "test",
System property:
testOptions in Test += Tests.Setup(() => System.setProperty("specs2.outDir", "/target/specs2-reports")) //Option1 //testOptions in Test += Tests.Setup(() => System.setProperty("specs2.junit.outDir", "/target/specs2-reports")) //Option2 testOptions in Test += Tests.Argument(TestFrameworks.Specs2, "console", "junitxml")
If I run the command below, it does not generate any specification reports in the above directory ("/ target / specs2-reports").
sbt> test
If I run the command below, it requests a directory, as shown in the error message below:
sbt> test-only - junitxml
[error] Failed to run test code .model.UserSpec: java.lang.IllegalArgumentException: junitxml requires specifying a directory, for example: junitxml (directory = "xxx")
And it only works if I provide a directory as shown below:
sbt> test-only - junitxml (directory = "\ target \ specs-reports")
But sometimes it does not generate all specifications, xmls reports (sometimes it generates only one report, sometimes only two reports, etc.).
If I give test-only - junitxml (directory = "\ target \ specs-reports") in jenkins, it gives the following error.
[error] Not a valid key: junitxml (similar: ivy-xml) [error] junitxml( [error] ^
My main goal: I want to generate consolidated test reports in junit xml format and integrate with Jenkins. Please help me solve my problem.
Best wishes,
Hari