[Cucumber] [JVM] Specifying report format properties for maven

2,373 views
Skip to first unread message

Jason Nah

unread,
May 10, 2012, 9:03:18 PM5/10/12
to cu...@googlegroups.com
Hi,

I've managed to get cucumber-jvm running, and the jenkins cucumber-jvm report tool also running.

In the configuration of the jenkins cucumber-jvm report, it indicates to include the following lines...

@Cucumber.Options(format = {"pretty", "html:target/cucumber", "json:target/cucumber.json"})

Is there an equivalent way of setting the configuration but via the maven pom.xml file instead? Perhaps as a system property... setting it in the JUnit runner seems inflexible. For instance, in eclipse, you don't want the pretty output.

I have managed to configure (in the past) maven to produce a pretty report by using this:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>2.11</version>
  <configuration>
    <systemPropertyVariables>
      <cucumber.reporter>pretty</cucumber.reporter>
    </systemPropertyVariables>
  </configuration>
</plugin>


This was using cucumber-jvm 1.0 (although I suspect the variable should be cucumber.formatter)...

Cheers,
Jason

aslak hellesoy

unread,
May 10, 2012, 10:16:32 PM5/10/12
to cu...@googlegroups.com
Yes, being able to override via system properties makes sense. How about this:

https://github.com/cucumber/cucumber-jvm/commit/269712f6485d7a1440c4068817a623798ff3d48c
I didn't end up creating a property for each option - that just
complicates things both implementation wise and usage wise.

Just one cucumber.options to rule them all.

Aslak

> Cheers,
> Jason
>
> -- There are two rules:
>
> 1) Please prefix the subject with [Ruby], [JVM] or [JS]. This allows people
> to filter messages.
> 2) Please use interleaved answers
> http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
>
> You received this message because you are subscribed to the Google Groups
> Cukes group. To post to this group, send email to cu...@googlegroups.com. To
> unsubscribe from this group, send email to
> cukes+un...@googlegroups.com. For more options, visit this group at
> https://groups.google.com/d/forum/cukes?hl=en

Jason Nah

unread,
May 10, 2012, 11:51:06 PM5/10/12
to cu...@googlegroups.com
Looks great... would make it easier to integrate across CI, Build systems etc etc...

Thanks Aslak.

How was cucumber.reporter being used in the first place? Was digging through the codebase and I could see how you would hook up to it. Unless this was something in 1.0 and moved on in the future releases...

Aslak Hellesøy

unread,
May 11, 2012, 12:10:23 AM5/11/12
to cu...@googlegroups.com




On May 10, 2012, at 22:51, Jason Nah <jaso...@gmail.com> wrote:

Looks great... would make it easier to integrate across CI, Build systems etc etc...

Thanks Aslak.

How was cucumber.reporter being used in the first place? Was digging through the codebase and I could see how you would hook up to it. Unless this was something in 1.0 and moved on in the future releases...


It was a somewhat ugly hack before we had a good argument parser so I yanked it. Don't remember when exactly.

Aslak

kingsleyh

unread,
May 16, 2012, 5:42:31 PM5/16/12
to Cukes
Hi

It's a good point that setting formatters in junit is a bit inflexible
- especially as pretty actually looks ugly in windows and the IDE's

However I wanted to highlight that only the json report is required in
order for the cucumber-jvm Jenkins reporting to work - pretty and HTML
are not required.

Hopefully people are using the java implementation of the Jenkins
plugin: https://github.com/masterthought/jenkins-cucumber-jvm-reports-plugin-java

I did first write one in ruby but Jenkins ruby plugin support is
experimental at best so i have ditched it in favour of the java
version which has all the improvements and focus.


On May 11, 5:10 am, Aslak Hellesøy <aslak.helle...@gmail.com> wrote:
> On May 10, 2012, at 22:51, Jason Nah <jason....@gmail.com> wrote:
>
> Looks great... would make it easier to integrate across CI, Build systems
> etc etc...
>
> Thanks Aslak.
>
> How was cucumber.reporter being used in the first place? Was digging
> through the codebase and I could see how you would hook up to it. Unless
> this was something in 1.0 and moved on in the future releases...
>
> It was a somewhat ugly hack before we had a good argument parser so I
> yanked it. Don't remember when exactly.
>
> Aslak
>
> On 11 May 2012 12:16, aslak hellesoy <aslak.helle...@gmail.com> wrote:
> >https://github.com/cucumber/cucumber-jvm/commit/269712f6485d7a1440c40...
> 2) Please use interleaved answershttp://en.wikipedia.org/wiki/Posting_style#Interleaved_style
Reply all
Reply to author
Forward
0 new messages