When Cucumber (the original ruby implementation) become somewhat
mature a couple of years ago I was thinking: Cucumber can run on JRuby
as well, and with some glue code it should be possible to write Step
Definitions in various JVM languages such as Java, Groovy, Scala,
Clojure etc. So Cuke4Duke was born.
It has worked well for some, less well for others. Since day 1 it has
had several inherent problems:
1) Hard to install. Cuke4Duke is based on JRuby, the Cucumber gem and
the Gherkin gem. Installing these in a Java environment is hard.
2) Slow. Every time you want to run a feature you have to wait for
JRuby to boot.
3) Hard to use. Maven makes it a little easier perhaps, but Maven
comes with its own warts.
4) Unstable. Consider the blocks that build up Cuke4Duke: JVM, JRuby,
RubyGems, Cucumber gem, Gherkin gem, Maven. For the sake of
simplicity, let's assume that each of those exists in 4 versions. That
means some 15.000 different combinations people might have on their
machines. And then there is Windows/Linux/OS X differences on top of
that.
5) Hard to test. Given the number of different permutations this
speaks for itself.
6) Hard to package and release. A hodge podge of Maven and Rake, plus
dealing with all of the dependencies.
The problems have been getting worse lately, and it's time to retire
the project because of its inherent flaws. As of today I will no
longer maintain Cuke4Duke. Instead I'll spend my time working on a
better replacement.
As some of you may know, I have been working on a pure JVM
implementation of Cucumber for a while. It incorporates the good parts
of Cuke4Duke, but not the bad ones (I hope). I think it's good enough
that some people can start playing with it. Here is where it's at:
* Mostly API compatible with Cuke4Duke
* Gherkin features can remain unchanged
* Step Definitions and Hooks will have to change some import statements
* The Java implementation is tested better than the other JVM
languages like Groovy etc, but they are there too.
* Scala has no support yet, will add that later.
* You can run features with JUnit
* A (JUnit-free) CLI is in progress (handy for e.g. Clojure or other
languages that don't use JUnit)
* It will be a lot faster
* Not a single line of Ruby and no JRuby
There are no docs yet, that will come later. I'm looking for people
who have some small to medium sized Cuke4Duke projects who would like
to try switching over. This will expose what the missing features are,
what needs to be documented etc.
Cucumber-JVM is currently not released anywhere, so you'll have to
build it yourself: https://github.com/cucumber/cucumber-jvm
For those who try - don't expect everything to work. I do need your
help testing it out to make it stabilise faster and get the features
it needs. I'll be here answering any questions you might have. I'm
*very* excited about this project! And we need contributors! Show the
Ruby community that the Java/Groovy/Clojure/Scala people can
contribute to open source too!
Cheers,
Aslak
Aslak, this is great news and I'll give this a whirl immediately with our existing cuke4duke tests.
However as of August 16th, the "gem install cuke4duke" stopped working, as described in thread "trouble installing gherkin gem" (log at https://gist.github.com/1152852). Would you be willing to invest a little time in it?
Meanwhile I'll jump right on this Cucumber-jvm, since the old cuke4duke no longer works on our continuous integration servers.
-Alan Wostenberg
That problem should be fixed if you install gherkin-2.4.11
(2.4.7-2.4.10 were all broken due to a rubygems/yaml bug and it took
me several releases to figure out how to work around it).
> Meanwhile I'll jump right on this Cucumber-jvm, since the old cuke4duke no
> longer works on our continuous integration servers.
>
Great! Looking forward to hearing what your first stumble is so I can
start documenting and improving it :-)
Aslak
> --
> You received this message because you are subscribed to the Google Groups
> "Cukes" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/cukes/-/wkXdhAXqZs4J.
> 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.
>
On Thu, Aug 18, 2011 at 4:47 PM, Alan Wostenberg <awo...@gmail.com> wrote:
> Aslak, this is great news and I'll give this a whirl immediately with our
> existing cuke4duke tests.
>
> However as of August 16th, the "gem install cuke4duke" stopped working, as
> described in thread "trouble installing gherkin gem" (log at
> https://gist.github.com/1152852). Would you be willing to invest a little
> time in it?
>That problem should be fixed if you install gherkin-2.4.11
(2.4.7-2.4.10 were all broken due to a rubygems/yaml bug and it took
me several releases to figure out how to work around it).
Try completely removing uninstalling any previously installed (broken)
gherkin gems.
> So it seems there is still something amis installing cuke4duke. Others
> report this here http://www.ruby-forum.com/topic/2380026.
> I'll switch to Cucumber-jvm today.
If by "switch" you mean "try", go ahead. Expect some early adopter pain.
Aslak
> https://groups.google.com/d/msg/cukes/-/pfN55Jp-cOcJ.
It's a RubyGems/YAML bug. JRuby 1.6.3 ships with rubygems 1.5.1.
Upgrading rubygems makes it possible to install gherkin:
gem install rubygems-update
gem update --system
The only problem is - this works with a regular jruby installation.
Upgrading the JRuby downloaded by maven? I have no idea.
Ready to take cucumber-jvm for a spin? Cuke4Duke is going nowhere
while ruby land is as buggy as this.
Aslak
> --
> You received this message because you are subscribed to the Google Groups
> "Cukes" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/cukes/-/KC8kgk17yf4J.
What fix?
> Now that it's fixed, don't we need to push the fixed gems into rubygems?
>
What gems?
> --
> You received this message because you are subscribed to the Google Groups
> "Cukes" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/cukes/-/vY1OVGiOPMIJ.
On Thu, Aug 18, 2011 at 5:18 PM, Alan Wostenberg <awo...@gmail.com> wrote:
>
>
> On Thursday, August 18, 2011 9:57:48 AM UTC-6, Aslak Hellesøy wrote:
>>
>> On Thu, Aug 18, 2011 at 4:47 PM, Alan Wostenberg <awo...@gmail.com> wrote:
>> > Aslak, this is great news and I'll give this a whirl immediately with
>> > our
>> > existing cuke4duke tests.
>> >
>> > However as of August 16th, the "gem install cuke4duke" stopped working,
>> > as
>> > described in thread "trouble installing gherkin gem" (log at
>> > https://gist.github.com/1152852). Would you be willing to invest a
>> > little
>> > time in it?
>> >
>>
>> That problem should be fixed if you install gherkin-2.4.11
>> (2.4.7-2.4.10 were all broken due to a rubygems/yaml bug and it took
>> me several releases to figure out how to work around it).
>
> Yes, but notice the log (https://gist.github.com/1152852) shows that latest
> gherkin
> Successfully installed gherkin-2.4.11-javaTry completely removing uninstalling any previously installed (broken)
gherkin gems.
Yes, tried that. The first line of that gist (https://gist.github.com/1152852) removes all gems. But your idea led me to a solution. The trick is to install cucumber before cuke4duke:
gem install cucumber
gem install cuke4duke --version
This works on a clean machine.
> So it seems there is still something amis installing cuke4duke. Others
> report this here http://www.ruby-forum.com/topic/2380026.
> I'll switch to Cucumber-jvm today.If by "switch" you mean "try", go ahead. Expect some early adopter pain.
My pom.xml has:
<gem>install gherkin --version 2.4.11</gem>
<gem>install cuke4duke --debug --verbose --backtrace</gem>
So I first install the latest gherkin gem, then cuke4duke
I delete my maven repository, and run
mvn -Dcucumber.installGems=true cuke4duke:cucumber
TL;DR: Cuke4Duke is dead. Viva Cucumber-JVM.
implementation of Cucumber for a while. It incorporates the good parts
of Cuke4Duke, but not the bad ones (I hope). I think it's good enough
that some people can start playing with it. Here is where it's at:
As some of you may know, I have been working on a pure JVM* Mostly API compatible with Cuke4Duke
* Gherkin features can remain unchanged
* Step Definitions and Hooks will have to change some import statements
* The Java implementation is tested better than the other JVM
languages like Groovy etc, but they are there too.
* Scala has no support yet, will add that later.
* You can run features with JUnit
* A (JUnit-free) CLI is in progress (handy for e.g. Clojure or other
languages that don't use JUnit)
* It will be a lot faster
* Not a single line of Ruby and no JRuby
--
You received this message because you are subscribed to the Google Groups "Cukes" group.
--
DK
AIM: DKroot1, Skype: DKroot
Sorry, sufficient context failure:
It's a Java project, built using Maven. We're using the
cuke4duke-maven-plugin to fire off cucumber feature tests for it.
We could probably build in something using maven-ant-tasks but it'd be
far uglier.
Thanks,
David
I've not worked with Maven, but it sounds like it would be helpful if there were a pre-built Maven task/target/rule/whatever that runs the plain Ruby Cucumber.
It night even be that this already exists in the cuke4duke Maven plug-in and just needs a little attention drawn to it.
Hi did a clean install of cuke jvm but got some errors ...
looksUpInstantiableSubclassesOnClassPath(cucumber.runtime.ClasspathTest)
looksUpFilesByDir(cucumber.runtime.ClasspathTest)
looksUpFilesByFile(cucumber.runtime.ClasspathTest)
<TEST-cucumber.runtime.ClasspathTest.xml>
You want to invoke methods in your Java code using Ruby (via JRuby) in
your step defs?
Please explain what technology your Java project uses (Web? Swing?
What frameworks?)
We could always add JRuby support in Cucumber-JVM, but I need to
understand why this would be preferrable over MRI and Cucumber-Ruby
(alive and kicking)..
I don't understand how the build tool (Ant/Maven) is relevant in this
regard. Please help me understand.
Aslak
> Thanks,
> David
> Am 19/08/2011 um 7:57 AM schrieb Dmitriy Korobskiy <dkr...@gmail.com>:
>
>> On 8/18/11 5:28 PM, David Kowis wrote:
>>> On Thu, Aug 18, 2011 at 3:57 PM, Dmitriy Korobskiy<dkr...@gmail.com> wrote:
>>>> On 8/18/11 2:11 PM, David Kowis wrote:
>>>>> I've got a couple projects that we're wanting to use Ruby step definitions
>>>>> to facilitate the writing of our tests.
>>>> What's stopping you from using native cucumber for those?
>>> Sorry, sufficient context failure:
>>>
>>> It's a Java project, built using Maven. We're using the
>> Got it. Maven... Sigh.
>>> cuke4duke-maven-plugin to fire off cucumber feature tests for it.
>>>
>>> We could probably build in something using maven-ant-tasks but it'd be
>>> far uglier.
>> Isn't it well, strange that a simple command like invocation (>cucumber ...) is somehow
>> problematic to do with Maven? I'm using Ant for build and it's a piece of cake as it should be.
>>
>
> I've not worked with Maven, but it sounds like it would be helpful if there were a pre-built Maven task/target/rule/whatever that runs the plain Ruby Cucumber.
>
Can you give an example of a technology stack where you think this
would be helpful?
Aslak
> It night even be that this already exists in the cuke4duke Maven plug-in and just needs a little attention drawn to it.
>
Perhaps, if you have an external Jruby, the cuke4duke-maven-plugin
wraps it all in, as it should be, so it's very convienient and
relatively easy to use.
(When rubygems isn't horking everything up.)
David
Yep. Same as if you're using scala or groovy. It'd be nice if we could
use other ruby gems as well, but I was going to cross that bridge when
I came to it.
>
> Please explain what technology your Java project uses (Web? Swing?
> What frameworks?)
Spring. Hibernate. Jersey. It's a web service. Deployed in glassfish,
but for testing just running in Jetty.
>
> We could always add JRuby support in Cucumber-JVM, but I need to
> understand why this would be preferrable over MRI and Cucumber-Ruby
> (alive and kicking)..
>
> I don't understand how the build tool (Ant/Maven) is relevant in this
> regard. Please help me understand.
Maybe then I don't completely understand how it works.
Cuke4Duke handles running cucumber, and jruby and everything.
As well as enabling step definitions in other languages.
The cuke4duke-maven-plugin also integrates it nicely with maven so
that we can just have it run as part of our integration test.
It doesn't require having an installation of Ruby (JRuby or otherwise)
on the system, which makes it easier to deal with Continuous
Integration servers.
The build tool stuff is mostly for context, we liked being able to
easily add in the ability to run cucumber features to our projects.
And our testers, as well as some of the developers, really like being
able to write the step definitions in ruby. We're using maven for all
of our java projects, potentially moving to Gradle at some point in
the future.
Is there a different way to do this easier that I've completely missed
out on? Hopefully I've made myself more clear. I guess I thought that
cucumber-jvm would basically be just like the existing way we're using
cuke4duke, but instead of calling out to ruby to run the cucumber
features, it'd just do it in native java.
Thanks,
David
Installing gems "into" a JRuby that is a plain JRuby jar file (and not
a regular zipfile installation) is somewhat tricky, and has been a
constant source of frustration in cuke4duke. It's possible, setting
GEM_HOME and GEM_PATH, but anyone who has worked with environment
variables in Java know that's tricky as well. If someone has a good
recipe for doing this, please share.
We'll probably add JRuby (and Jython) support, in the same vein as the
other JVM languages already supported. Having Maven/Ant/Gradle/your
favourite build tool install gems/eggs is still going to be a little
tricky (see above). Hopefulley someone will contribute some nice
recipes for the cucumber-jvm wiki here...
We can only fix errors if we know what they are.
> Could have been pbkc errors, I admit as this is my third week with java/maven.
> Can I use a fit style table structure with cucumber jvm...
Yes, featuers are still written in Gherkin - that won't change.
> is there a capybara equivalent.
Yes - Selenium
That's awesome Cedric. Let's take the time to discuss what we
like/dislike from Cucumber Ruby's (crb) table diffing so we can make
it even better.
Crb's diff attempts to do a diff of rows as well as columns. In
practice I have never found a need for column diffing, so I'm open for
removing that if it simplifies the implementation.
Another thing Crb's diff does is to require the presence of a header
row. This row is used to reorder columns in case we're comparing with
a table of hashes. This is a little too clever as well, and I'd like
to remove that too. So here are the changes I propose:
* No header row required (and now reordering of columns before diffing)
* No column diffing
Does anyone see any problems with this?
> I hope to have more time in
> order to finish it until next week. This part is a little bigger than I
> initially thought, but I'm not afraid!! For the diff part I've found an LCS
> implementation based on Myers Algorithm for java[1], I'll see if the results
> are different in this case from the Hunt–McIlroy algorithm used in Ruby
> Cucumber.
>
If you don't have any luck with Myers, it should be fairly easy to
port the code from
https://github.com/halostatue/diff-lcs/blob/master/lib/diff/lcs.rb
There is a very short Diff LCS implementation here:
http://introcs.cs.princeton.edu/java/96optimization/ - haven't studied
it, so I don't know if it's the same algo (Hunt–McIlroy)
Aslak
On Thu, Aug 18, 2011 at 9:08 PM, Cedric LamalleThat's awesome Cedric. Let's take the time to discuss what we
<cedric....@gmail.com> wrote:
> Hi,
> Just a few more words about this transition, there is a plan to put cucumber
> artifacts on Maven Central. With this using Cumcumber-JVM in a maven project
> will be as simple as adding a dependency in the pom...
>
> I've been a little away ultimately, but I'm still working on the Table
> implementation. I'm trying to stay as close as possible to the original
> specification (spec/cucumber/ast/table_spec.rb).
like/dislike from Cucumber Ruby's (crb) table diffing so we can make
it even better.
Crb's diff attempts to do a diff of rows as well as columns. In
practice I have never found a need for column diffing, so I'm open for
removing that if it simplifies the implementation.
Another thing Crb's diff does is to require the presence of a header
row. This row is used to reorder columns in case we're comparing with
a table of hashes. This is a little too clever as well, and I'd like
to remove that too. So here are the changes I propose:
* No header row required (and now reordering of columns before diffing)
* No column diffing
Does anyone see any problems with this?
If you don't have any luck with Myers, it should be fairly easy to
> I hope to have more time in
> order to finish it until next week. This part is a little bigger than I
> initially thought, but I'm not afraid!! For the diff part I've found an LCS
> implementation based on Myers Algorithm for java[1], I'll see if the results
> are different in this case from the Hunt–McIlroy algorithm used in Ruby
> Cucumber.
>
port the code from
https://github.com/halostatue/diff-lcs/blob/master/lib/diff/lcs.rb
There is a very short Diff LCS implementation here:
http://introcs.cs.princeton.edu/java/96optimization/ - haven't studied
it, so I don't know if it's the same algo (Hunt–McIlroy)
Parsing longer cell diffs might call for an eye-friendly cell-by-cell
format option. A stab at this:
| name
| email
| phone |
(~)| Aslak
| (-)as...@email.longwinded_alternate_that_wraps_80_chars_by_dint_of_corporate_necessity.com
(+)as...@mel.com
| 123 |
Bill
Likewise, you can do a query to turn a bunch of AR objects into [{},{}] : MyRecord.find(...).map(&:attributes)
This led me to implement diff so that you could pass a [{},{}] to diff against. This required a top header so that the [{},{}] could be turned into [[],[], []], using the keys as headers, and sorting them according to the original table.
This was a bad decision on my part. It complicates the diff implementation considerably, and for a bad reason. It would be much better to have an external method, say SomeUtil.to_array([{},{}], :foo, :bar, :zap) to turn this into an array of arrays.
Aslak,
this is great news.
I just gave it a whirl,
and got up to the point where I try to run a
feature.
Afterwards it's
cucumber.runtime.CucumberException: Failed to scan jar[1]
Caused by: java.io.FileNotFoundException: C:\Dokumente%20und
%20Einstellungen\ur\.m2\repository\info\cukes\cucumber-java\1.0.0-
SNAPSHOT\cucumber-java-1.0.0-SNAPSHOT.jar,
but the file is definitely there.
I'm launching the test via IntelliJ IDEA 10.5.1 on WinXP, the
repository is a Maven3 repo.
Could you guess what I need to do to get this running?
Out of curiosity, why would Cucumber even need to scan its own .jar
file?
--
Does this mean you have successfully run mvn install?
Sounds like a Java-on-Windows bug that we need to add a workaround for. Spaces in file names is a common source of bugs on Windows. It would be great if you could help with a fix.
Diffing with converted objects could in theory be useful for something like this:List<Person> people = ...;Table actual = new Table(people);table.diff(actual)However, I don't think that will be a common use case. You might as well do:List<Person> people = ...;Table peopleTable = toTable(people, table.getLocale()); // This could be a static utility method that uses reflection to create List<List<String>> internally.table.diff(actual)Most uses of table diffing I have seen compares data from a web page, where everything is strings anyway, extracted from Selenium's DOM.Unless I'm missing why diffing on converted objects is important I think we should consider simplifying the diffing logic to work only on strings. What do you think?
I love the code that turns rows into a list of beans! It would if it could also set public fields (without getters or setters) as well as invoking constructors (using the same argument order as the table), but that's something we can add later.
Diffing with converted objects could in theory be useful for something like this:List<Person> people = ...;Table actual = new Table(people);table.diff(actual)However, I don't think that will be a common use case. You might as well do:List<Person> people = ...;Table peopleTable = toTable(people, table.getLocale()); // This could be a static utility method that uses reflection to create List<List<String>> internally.table.diff(actual)Most uses of table diffing I have seen compares data from a web page, where everything is strings anyway, extracted from Selenium's DOM.Unless I'm missing why diffing on converted objects is important I think we should consider simplifying the diffing logic to work only on strings. What do you think?The idea was, as you stated above, to be able to compare with an expected list of object. That way it will be possible to format the resulting diff, instead of an assertEquals(expectedList, actualList) which doesn't show where are the differences. Maybe this won't be as useful as I thought.
public class Cucumber extends Suite {
private static final Runtime runtime = new Runtime();
private static JUnitReporter jUnitReporter;
I started patching this class by turning the above fields into thread-local fields, but that didn't yet resolve the issue. Are there any plans to get Cucumber-JVM to work in a concurrent test scenario?
There are currently no plans, but it would obviously be great if it
worked. I have created an issue for this:
https://github.com/cucumber/cucumber-jvm/issues/86
I'm currently focussed on Milestone-1:
https://github.com/cucumber/cucumber-jvm/issues?milestone=1&state=open
Aslak
> --
> You received this message because you are subscribed to the Google Groups
> "Cukes" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/cukes/-/aoQqL1sOrRIJ.
It would be better if you could fork cucumber-jvm, clone it, create a
branch called parallel and add it under examples. Then push to your
fork. Zip files are too hard to deal with. Having it all in git is
better. In case you're new to git:
* press the fork button
* git clone ..your fork url..
* cd cucumber-jvm
* git checkout -b parallel
* Put your code under examples
* git add .
* git commit -m "Example to demonstrate parallel is broken"
* git push
Aslak
> Thanks
> Christian
>
> --
> You received this message because you are subscribed to the Google Groups
> "Cukes" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/cukes/-/yTFYxVeB1A4J.
>> > cukes+unsubscribe@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/cukes?hl=en.
>> >
>
> -- 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+unsubscribe@googlegroups.com. For more options, visit this group at