--dry-run - what for

609 views
Skip to first unread message

aslak hellesoy

unread,
Oct 23, 2011, 4:27:55 PM10/23/11
to Cucumber Users
Is anyone using --dry-run ? I haven't used it myself, and I'm
wondering whether or not to add it to Cucumber-JVM.

What is it good for?

Aslak

Andy Waite

unread,
Oct 23, 2011, 4:47:18 PM10/23/11
to cu...@googlegroups.com
I use it a lot. Our team writes acceptance criteria on a wiki before we convert it into feature files and it's useful for catching issues such as a Scenario being used with Examples instead of Scenario Outline.

I also use in combination with the autoformatter, otherwise warnings appear within the feature files where there are missing step definitions.

-- 
Andy Waite
Sent with Sparrow
--
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 http://groups.google.com/group/cukes?hl=en.

Vamsi

unread,
Oct 23, 2011, 5:25:04 PM10/23/11
to cu...@googlegroups.com
I used it Aslak  but it wasn't really very helpful. I don't even  know if it worked fine as it was mentioned in the Cucumber book .
Vamsi

aslak hellesoy

unread,
Oct 23, 2011, 5:44:06 PM10/23/11
to cu...@googlegroups.com
On Sun, Oct 23, 2011 at 10:25 PM, Vamsi <vamsi.m...@gmail.com> wrote:
> I used it Aslak  but it wasn't really very helpful. I don't even  know if it
> worked fine as it was mentioned in the Cucumber book .

Now I'm confused. Are you saying it didn't work the way you expected it to?

Aslak

Mike Sassak

unread,
Oct 23, 2011, 6:26:57 PM10/23/11
to cu...@googlegroups.com

I have been wondering this myself. I think dry-run is useful, but it'd
be an improvement if its uses were given better names (and support) in
Cucumber. Off the top of my head I think separate --check-syntax and
--no-execute flags might be more meaningful.

Mike

Richard Lawrence

unread,
Oct 23, 2011, 9:38:30 PM10/23/11
to cu...@googlegroups.com
On Sun, Oct 23, 2011 at 3:27 PM, aslak hellesoy
<aslak.h...@gmail.com> wrote:

I use it with the JSON formatter to do other things with features,
scenarios, and steps (analysis, integration, etc.). If formatters live
more in Gherkin and it were as obvious how to use Gherkin's CLI as
Cucumber's, I'd probably not need the dry run switch on Cucumber. Not
sure if that's ultimately a goal for Gherkin, but it seems like it
might be.

Richard

Vamsi

unread,
Oct 24, 2011, 5:34:51 AM10/24/11
to cu...@googlegroups.com
Yes, Aslak it didn't really work the way it was mentioned in the cucumber book . I did try it a few times but I gave up !!

aslak hellesoy

unread,
Oct 24, 2011, 5:49:32 AM10/24/11
to cu...@googlegroups.com
On Mon, Oct 24, 2011 at 10:34 AM, Vamsi <vamsi.m...@gmail.com> wrote:
> Yes, Aslak it didn't really work the way it was mentioned in the cucumber
> book . I did try it a few times but I gave up !!

We should fix that. What's happening instead?

Aslak

Vamsi

unread,
Oct 24, 2011, 6:10:24 AM10/24/11
to cu...@googlegroups.com
On 24 October 2011 10:49, aslak hellesoy <aslak.h...@gmail.com> wrote:
On Mon, Oct 24, 2011 at 10:34 AM, Vamsi <vamsi.m...@gmail.com> wrote:
> Yes, Aslak it didn't really work the way it was mentioned in the cucumber
> book . I did try it a few times but I gave up !!

We should fix that. What's happening instead?

Aslak
 I used it a few times, according to cucumber help; the dry run should only try to look for errors is Gherkin and mismatching steps/defs  however, I find that it tries to open the IE browser . Is it the expected behaviour ?
Vamsi

Matt Wynne

unread,
Oct 24, 2011, 6:25:47 AM10/24/11
to cu...@googlegroups.com
This highlights the let-down of the --dry-run option. It *should* allow you to check for undefined or unused steps quickly. In a large suite of features this is essential when you're refactoring step defs.

However, in practice, the way we load code in support / step definitions normally means that --dry-run doesn't work. If you have any dependency at all from step_definitions => env.rb, or from any other files in support => env.rb then it will fail to run.

@Vamsi, you need to make sure that the code which loads the browser is in env.rb; AFAIK that is the file that's skipped when --dry-run is invoked.

cheers,
Matt

--
Freelance programmer & coach

Mike Sassak

unread,
Oct 24, 2011, 10:37:11 AM10/24/11
to cu...@googlegroups.com
On Mon, Oct 24, 2011 at 5:25 AM, Matt Wynne <ma...@mattwynne.net> wrote:
>
> On 24 Oct 2011, at 11:10, Vamsi wrote:
>
>
> On 24 October 2011 10:49, aslak hellesoy <aslak.h...@gmail.com> wrote:
>>
>> On Mon, Oct 24, 2011 at 10:34 AM, Vamsi <vamsi.m...@gmail.com> wrote:
>> > Yes, Aslak it didn't really work the way it was mentioned in the
>> > cucumber
>> > book . I did try it a few times but I gave up !!
>>
>> We should fix that. What's happening instead?
>>
>> Aslak
>>  I used it a few times, according to cucumber help; the dry run should
>> only try to look for errors is Gherkin and mismatching steps/defs  however,
>> I find that it tries to open the IE browser . Is it the expected behaviour ?
>
> Vamsi
>
> This highlights the let-down of the --dry-run option. It *should* allow you
> to check for undefined or unused steps quickly. In a large suite of features
> this is essential when you're refactoring step defs.
> However, in practice, the way we load code in support / step definitions
> normally means that --dry-run doesn't work. If you have any dependency at
> all from step_definitions => env.rb, or from any other files in support =>
> env.rb then it will fail to run.

This highlights why I think it should be renamed and / or split into
multiple complementary options. "Dry run" is kind of vague, so its
correct behavior is hard to pin down and test. If we had an option
like "--search-mappings [OPTIONS]" where options could include keys
like "unused" and "undefined" as well as general search terms, I bet
that the problems with it would vanish.

Mike

> @Vamsi, you need to make sure that the code which loads the browser is in
> env.rb; AFAIK that is the file that's skipped when --dry-run is invoked.
> cheers,
> Matt
> --
> Freelance programmer & coach
> Author, http://pragprog.com/book/hwcuc/the-cucumber-book (with Aslak
> Hellesøy)
> Founder, http://relishapp.com
> +44(0)7974430184 | http://twitter.com/mattwynne
>

Andrii Dzynia

unread,
Sep 11, 2012, 12:17:52 PM9/11/12
to cu...@googlegroups.com
So guys who knows, how it currently works?

I tried to run --dry-run in cucumber.options but it's required to start browser. I was thinking that this is just syntax check.

Oscar Rieken

unread,
Sep 11, 2012, 12:33:55 PM9/11/12
to cu...@googlegroups.com
I set up a rake task for using --dry-run

the reason
new people(ba's qa's dev's) joining our team without an experience using (ruby or understanding the correct syntax for writing the feature files) 
that find themselves knee deep in the feature files. before they check in we ask them to run the task to check for errors before they check in 
the thought is that checking in features with errors will break things in CI or for other people working on the project

Aslak

Andrii Dzynia

unread,
Sep 11, 2012, 12:38:12 PM9/11/12
to cu...@googlegroups.com
Ok, so should it work with that command ? mvn clean test -Dcucumber.options="--dry-run"

Matt Wynne

unread,
Sep 15, 2012, 5:08:23 PM9/15/12
to cu...@googlegroups.com
On 11 Sep 2012, at 17:33, Oscar Rieken wrote:



On Sun, Oct 23, 2011 at 4:27 PM, aslak hellesoy <aslak.h...@gmail.com> wrote:
Is anyone using --dry-run ? I haven't used it myself, and I'm
wondering whether or not to add it to Cucumber-JVM.

What is it good for?

I set up a rake task for using --dry-run

the reason
new people(ba's qa's dev's) joining our team without an experience using (ruby or understanding the correct syntax for writing the feature files) 
that find themselves knee deep in the feature files. before they check in we ask them to run the task to check for errors before they check in 
the thought is that checking in features with errors will break things in CI or for other people working on the project

Yep, I use it to check for unused step defs, that kind of thing. It rarely works on Ruby projects though, because of the way we load support / step def folders.


Aslak

--
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 http://groups.google.com/group/cukes?hl=en.



--
-- Rules --
 
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
 
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
 
 

cheers,
Matt

--
Freelance programmer & coach
Author, http://pragprog.com/book/hwcuc/the-cucumber-book
Reply all
Reply to author
Forward
0 new messages