JUnit XML reports AND standard out reports

1,100 views
Skip to first unread message

Ian Forsey

unread,
Jan 2, 2014, 11:19:09 AM1/2/14
to scalate...@googlegroups.com
Hi,

I am using ScalaTest 2.0 and have the following in my build.sbt to generate junit XML reports for our CI environment:

testOptions in ThisBuild <+= (target in Test) map {
  t => Tests.Argument("-u", t + "/test-reports")
}

This works as expected, however adding this suppresses output in the console and I no longer see this green/red output for passing/failing tests such as:

[info] WordSplitterTest:
[info] Basic Word Splitter
[info] - should split words on spaces
[info] German Word Splitter
[info] - should split words using file

Is there a way to have both the junit XML reports generated AND keep the above console output?

Thanks

Ian

Bill Venners

unread,
Jan 2, 2014, 12:00:52 PM1/2/14
to scalate...@googlegroups.com
Hi Ian,

Try adding a -o, like this:


testOptions in ThisBuild <+= (target in Test) map {
  t => Tests.Argument("-o", "-u", t + "/test-reports")
}

The -o refers to the output sent to sbt's Logger, which is what shows up on standard output, when running with sbt. You can configure that output just like regular standard output with letters after -o. For example, -oD would give you durations printed with each completion event. Full list is here:

http://doc.scalatest.org/2.0/index.html#org.scalatest.tools.Runner$@configuringReporters

I will add a mention of -o to the Framework Scaladoc and in the user guide. (By the way, I was describing here how it works with new new Framework API, which requires sbt 0.13 or later.)

Thanks.

Bill


--
You received this message because you are subscribed to the Google
Groups "scalatest-users" group.
To post to this group, send email to scalate...@googlegroups.com
To unsubscribe from this group, send email to
scalatest-use...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/scalatest-users?hl=en
ScalaTest itself, and documentation, is available here:
http://www.artima.com/scalatest
---
You received this message because you are subscribed to the Google Groups "scalatest-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalatest-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Bill Venners
Artima, Inc.
http://www.artima.com

Ian Forsey

unread,
Jan 2, 2014, 1:09:29 PM1/2/14
to scalate...@googlegroups.com
Hi Bill,

Many thanks for the quick response; it works a treat!

That documentation was exactly what I was looking for, but I was looking in the user guide.
Reply all
Reply to author
Forward
0 new messages