usametov / specs

Automatically exported from code.google.com/p/specs
Other
0 stars 0 forks source link

Add surefire XML runner/reporter, make this available through SBT test framework #167

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
To integrate into a build server, such as Hudson, it is desirable to produce 
test report in a manner compatible with the Maven Surefire plugin. There is a  
SBT plugin 'surefire-sbt', that attempts to do this in a generic way, but it is 
not compatible with Specs, as it expects the fully qualified class name to be 
parsable from suite and example descriptions.

It's much easier to directly produce this report within Specs; I've coded up a 
prototype: 
https://github.com/retronym/specs/commit/9a70db09745186fe8d42aeda29695161f352109
2

The internal structure of a test suite is flattened to fit into the format.

I'm testing out this prototype at the moment, and plan to update as I find 
issues with the XML output. I'm not sure of the cleanest way to expose as 
configuration to the SBT build whether and where to output surefire XML. Should 
these come in as test options?

Original issue reported on code.google.com by jzaugg on 27 Dec 2010 at 3:12

GoogleCodeExporter commented 8 years ago
> To integrate into a build server, such as Hudson, it is desirable to produce 
test report in a manner compatible with the Maven Surefire plugin.

This is a very good idea indeed.

> I'm not sure of the cleanest way to expose as configuration to the SBT build 
whether and where to output surefire XML. Should these come in as test options?

At the moment, I can create html reports from sbt in specs2 by passing:

- the output directory as a per project -D option (because I suppose it should 
be fairly stable)
- html as a command line option. The issue with this is that passing 
command-line options only work with "test-only" and not with "test" (AFAIK). 
Maybe we could ask Mark for a new feature?

Original comment by etorrebo...@gmail.com on 29 Dec 2010 at 6:14

GoogleCodeExporter commented 8 years ago
i'm happy to add them to testOption in the build config file. Just need to 
intepret them in the right place within specs.

Original comment by jzaugg on 29 Dec 2010 at 6:39

GoogleCodeExporter commented 8 years ago
The thing with testOptions is that you have to declare them in your project 
file. There's no way to write:

sbt> test                  // run all tests in sbt console
sbt> test -- junit-report  // run all tests and create a junit-report

Maybe the easiest thing is to create a test-junit-report action?

Original comment by etorrebo...@gmail.com on 11 Jan 2011 at 10:17

GoogleCodeExporter commented 8 years ago
And would that action would append additional test options before running specs?

Original comment by jzaugg on 11 Jan 2011 at 10:21

GoogleCodeExporter commented 8 years ago
Yes it would pass any more options after "--" to the test runner.

Original comment by etorrebo...@gmail.com on 20 Jan 2011 at 4:12

GoogleCodeExporter commented 8 years ago
BTW, I'm sorry but I didn't see the notification of your comment for the past 
10 days.
That email may have ended in my spam, this happens sometimes.

Original comment by etorrebo...@gmail.com on 20 Jan 2011 at 4:13

GoogleCodeExporter commented 8 years ago
I think I can close this issue now, right?

You can pass options to sbt 0.10 by writing: test-only -- options, without 
specifying a class name, this will run all the specs.

Original comment by etorrebo...@gmail.com on 26 Aug 2011 at 9:19