nilswloka / lein-cucumber

A simple leiningen plugin for running clojure-based cucumber-jvm specifications.
The Unlicense
39 stars 26 forks source link

problems with cucumber-clojure "1.1.3" #24

Closed mva closed 11 years ago

mva commented 11 years ago

When I upgrade the cucumber-clojure dependency to 1.1.3 (as in https://github.com/mva/lein-cucumber), the lein cucumber run crashes while trying to print out the first part of the report.

The stacktrace is quite long and ends with this:

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.rangeCheck(ArrayList.java:571)
    at java.util.ArrayList.get(ArrayList.java:349)
    at gherkin.formatter.PrettyFormatter.indentedLocation(PrettyFormatter.java:142)
    at gherkin.formatter.PrettyFormatter.printStep(PrettyFormatter.java:255)
    at gherkin.formatter.PrettyFormatter.match(PrettyFormatter.java:179)

Does anyone see the same crash with lein-cucumber and cucumber-clojure 1.1.3?

nilswloka commented 11 years ago

Thanks for reporting this, Michael. Seems to be a problem with PrettyFormatter in general (which, to make things worse, is used internally in addition to any formatter you specify at the command line). I will have a look at this as soon as possible.

In the meantime, I'll push a branch with a workaround (you will have to specify a formatter other than PrettyFormatter at the command line, tho).

nilswloka commented 11 years ago

Have a look at https://github.com/nilswloka/lein-cucumber/tree/upgrade-dependencies. It uses cucumber-clojure 1.1.3 and should work for you until I fixed the PrettyFormatter problem. You will need to specify a formatter with -f <formatter>.

nilswloka commented 11 years ago

Okay, we're running into https://github.com/cucumber/gherkin/pull/252 here. Until that one is merged and made its way into cucumber-jvm, I don't think I can do anything about the error you're experiencing.

If you don't actually need version 1.1.3 of cucumber-jvm (and there are no new features in the Clojure module that I'm aware of), your best bet is staying with the last working version.

I'll close this issue for now.

mva commented 11 years ago

Thanks Nils for tracking down the root cause. Confirmation that this issue is not caused by my setup helps me a lot. I stumbled across this particular problem while trying to work around another exception with stock lein-cucumber 1.0.2. I'll open another ticket for this.