Discussion:
[Cucumber] [JVM] Best way to run from command line with Groovy glue?
(too old to reply)
Mike Howells
2013-05-11 12:10:44 UTC
Permalink
We're successfully running Cucumber-JVM tests with Groovy glue in Jenkins
using the @RunWith JUnit wrapper, but we have situations where people need
to run the tests from the command line, e.g. because they're ssh logged
into a remote system and doing a bunch of other stuff on the command line.

So we want to be able to copy the jar file for the glue code onto the
remote system and run feature files from the command line, with results
shown in the classic 'pretty' coloured text format.

What's the best way to run tests from the command line with just a jar of
Groovy glue and some feature files?
--
-- 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 cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org To unsubscribe from this group, send email to cukes+***@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Mike Howells
2013-05-11 12:18:44 UTC
Permalink
Executing the JUnit wrapper via Maven (mvn -Dtest=TestFeatures test) is one
way of course, but it's pretty slow going through the Maven phases every
time when you're iteratively trying out new scenarios.
Post by Mike Howells
We're successfully running Cucumber-JVM tests with Groovy glue in Jenkins
to run the tests from the command line, e.g. because they're ssh logged
into a remote system and doing a bunch of other stuff on the command line.
So we want to be able to copy the jar file for the glue code onto the
remote system and run feature files from the command line, with results
shown in the classic 'pretty' coloured text format.
What's the best way to run tests from the command line with just a jar of
Groovy glue and some feature files?
--
-- 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 cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org To unsubscribe from this group, send email to cukes+***@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Mike Howells
2013-05-11 12:20:32 UTC
Permalink
Executing the JUnit wrapper via Maven (mvn -Dtest=TestFeatures test) is one
way of course, but it's pretty slow going through the Maven phases every
time when you're iteratively trying out new scenario, and you get all that
waffle output by Maven when you really just want to see the scenario steps.
Post by Mike Howells
We're successfully running Cucumber-JVM tests with Groovy glue in Jenkins
to run the tests from the command line, e.g. because they're ssh logged
into a remote system and doing a bunch of other stuff on the command line.
So we want to be able to copy the jar file for the glue code onto the
remote system and run feature files from the command line, with results
shown in the classic 'pretty' coloured text format.
What's the best way to run tests from the command line with just a jar of
Groovy glue and some feature files?
--
-- 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 cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org To unsubscribe from this group, send email to cukes+***@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Peter DoMySEO
2013-05-13 04:41:14 UTC
Permalink
Shell script containing required environment variables would do the job
java -cp "${LIB_DIR}/*" cucumber.api.cli.Main --glue ${GLUE_CODE}
${FEATURES_DIR} --format ....
Post by Mike Howells
We're successfully running Cucumber-JVM tests with Groovy glue in Jenkins
to run the tests from the command line, e.g. because they're ssh logged
into a remote system and doing a bunch of other stuff on the command line.
So we want to be able to copy the jar file for the glue code onto the
remote system and run feature files from the command line, with results
shown in the classic 'pretty' coloured text format.
What's the best way to run tests from the command line with just a jar of
Groovy glue and some feature files?
--
-- 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 cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org To unsubscribe from this group, send email to cukes+***@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Mike Howells
2013-05-13 05:37:57 UTC
Permalink
Okay, eventually worked out that this *does *work with Groovy glue but
requires an *enormous *class path to pick up all the dependencies:

java -cp <lots-and-lots-of-jars> cucumber.api.cli.Main --glue
classpath:com.mytest.cuke.glue path/to/features

Need to package all your glue code plus all dependencies into a single jar,
e.g. using maven-shade-plugin.
Post by Mike Howells
We're successfully running Cucumber-JVM tests with Groovy glue in Jenkins
to run the tests from the command line, e.g. because they're ssh logged
into a remote system and doing a bunch of other stuff on the command line.
So we want to be able to copy the jar file for the glue code onto the
remote system and run feature files from the command line, with results
shown in the classic 'pretty' coloured text format.
What's the best way to run tests from the command line with just a jar of
Groovy glue and some feature files?
--
-- 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 cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org To unsubscribe from this group, send email to cukes+***@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
aslak hellesoy
2013-05-13 12:03:17 UTC
Permalink
Post by Mike Howells
Okay, eventually worked out that this *does *work with Groovy glue but
Welcome to the JVM. That's why people use Ant/Maven/Ivy/Gradle/Buildr etc.
Post by Mike Howells
java -cp <lots-and-lots-of-jars> cucumber.api.cli.Main --glue
classpath:com.mytest.cuke.glue path/to/features
Need to package all your glue code plus all dependencies into a single
jar, e.g. using maven-shade-plugin.
Post by Mike Howells
We're successfully running Cucumber-JVM tests with Groovy glue in Jenkins
to run the tests from the command line, e.g. because they're ssh logged
into a remote system and doing a bunch of other stuff on the command line.
So we want to be able to copy the jar file for the glue code onto the
remote system and run feature files from the command line, with results
shown in the classic 'pretty' coloured text format.
What's the best way to run tests from the command line with just a jar of
Groovy glue and some feature files?
--
-- 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
To unsubscribe from this group, send email to
https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
-- 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 cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org To unsubscribe from this group, send email to cukes+***@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Mike Howells
2013-05-16 12:30:10 UTC
Permalink
Okay so that brings us back to the original question of how to easily run cucumber-jvm with groovy glue from the command line.

As I said earlier, we're using maven to build but it's slow and noisy (even with --quiet) if you just want to execute using ready-made glue. We're not going to use ant or gradle instead of maven.

So is creating an überjar with all dependencies the best/only way?

As
--
-- 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 cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org To unsubscribe from this group, send email to cukes+***@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
aslak hellesoy
2013-05-16 13:09:38 UTC
Permalink
Post by Mike Howells
Okay so that brings us back to the original question of how to easily run
cucumber-jvm with groovy glue from the command line.
As I said earlier, we're using maven to build but it's slow and noisy
(even with --quiet) if you just want to execute using ready-made glue.
We're not going to use ant or gradle instead of maven.
So is creating an überjar with all dependencies the best/only way?
#/bin/sh
java -cp all:your:jars cucumber.cli.Main $@

Aslak
Post by Mike Howells
As
--
-- 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
To unsubscribe from this group, send email to
visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
-- 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 cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org To unsubscribe from this group, send email to cukes+***@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Mike Howells
2013-05-13 05:41:26 UTC
Permalink
Okay, eventually worked out that this *does *work with Groovy glue but
requires an *enormous *class path to pick up all the dependencies:

java -cp <lots-and-lots-of-jars> cucumber.api.cli.Main --glue
classpath:com.mytest.cuke.glue path/to/features

Need to package all your glue code plus all dependencies into a single jar,
e.g. using maven-shade-plugin.
Post by Mike Howells
We're successfully running Cucumber-JVM tests with Groovy glue in Jenkins
to run the tests from the command line, e.g. because they're ssh logged
into a remote system and doing a bunch of other stuff on the command line.
So we want to be able to copy the jar file for the glue code onto the
remote system and run feature files from the command line, with results
shown in the classic 'pretty' coloured text format.
What's the best way to run tests from the command line with just a jar of
Groovy glue and some feature files?
--
-- 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 cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org To unsubscribe from this group, send email to cukes+***@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Loading...