I hope that makes senseDarrell
--
-- 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
Â
Â
I added this failure mode to help people who screw up their commanx line options, giving them a hint why no features were run.HiI'm working with an automated testing environment using ANT and Cucumber-JVM. The problem I'm facing is that we have two systems where we may need to run features against, some features are for landscape1 and some features for landscape2. I was going to use tags to define which scenario is for which landscape, however some features may not necessarily contain a scenario for both landscapes. This proves to be a problem when running cucumber with -tags @landscape1 if there are no scenarios defined then an exception is thrown[java] cucumber.runtime.CucumberException: None of the features at [build/test-classes, src/test/resources] matched the filters: [@landscape1][java] at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:45)   [java] at cucumber.runtime.RuntimeOptions.cucumberFeatures(RuntimeOptions.java:98)   [java] at cucumber.runtime.Runtime.run(Runtime.java:82)   [java] at cucumber.cli.Main.run(Main.java:20)   [java] at cucumber.cli.Main.main(Main.java:12)   [java] Running Shutdown Hook...   [java] Running Shutdown Hook executed!I was wondering if there was any method of telling cucumber not to throw the exception if no tags are found, or performing an initial check to see whether any tags exist first and if they exist run cucumber, if not then skip that feature file..Removing this might help you, but do a disservice to many others.What do people think?
On Fri, Jul 27, 2012 at 4:11 AM, Aslak Hellesøy <aslak.h...@gmail.com> wrote:I added this failure mode to help people who screw up their commanx line options, giving them a hint why no features were run.HiI'm working with an automated testing environment using ANT and Cucumber-JVM. The problem I'm facing is that we have two systems where we may need to run features against, some features are for landscape1 and some features for landscape2. I was going to use tags to define which scenario is for which landscape, however some features may not necessarily contain a scenario for both landscapes. This proves to be a problem when running cucumber with -tags @landscape1 if there are no scenarios defined then an exception is thrown[java] cucumber.runtime.CucumberException: None of the features at [build/test-classes, src/test/resources] matched the filters: [@landscape1][java] at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:45)   [java] at cucumber.runtime.RuntimeOptions.cucumberFeatures(RuntimeOptions.java:98)   [java] at cucumber.runtime.Runtime.run(Runtime.java:82)   [java] at cucumber.cli.Main.run(Main.java:20)   [java] at cucumber.cli.Main.main(Main.java:12)   [java] Running Shutdown Hook...   [java] Running Shutdown Hook executed!I was wondering if there was any method of telling cucumber not to throw the exception if no tags are found, or performing an initial check to see whether any tags exist first and if they exist run cucumber, if not then skip that feature file..Removing this might help you, but do a disservice to many others.What do people think?I think the same results as in Ruby makes the most sense to me.0 scenarios0 steps0m0.000sFeedback of 0's is pretty good information.It doesn't necessarily "feel" like an exception to me, so I'd rather not get a stack trace there.Â
package cucumber.hackedrunner;
import cucumber.api.cli.Main;import cucumber.runtime.CucumberException;import cucumber.runtime.Runtime;import cucumber.runtime.RuntimeOptions;import cucumber.runtime.io.MultiLoader;
import java.io.IOException;
public class HackedRunner extends Main {
  public static void main(String[] argv) throws Throwable {    run(argv, Thread.currentThread().getContextClassLoader());  }
  public static void run(String[] argv, ClassLoader classLoader) throws IOException {    RuntimeOptions runtimeOptions = new RuntimeOptions(System.getProperties(), argv);
    cucumber.runtime.Runtime runtime = new Runtime(new MultiLoader(classLoader), classLoader, runtimeOptions) {      @Override      public void run() {        try {          super.run();        } catch (CucumberException e) {          if (e.getMessage().contains("None of the features")) {            System.err.println(e.getMessage());          } else {            throw e;          }        }      }    };    runtime.writeStepdefsJson();    runtime.run();    System.exit(runtime.exitStatus());  }}
HiI'm working with an automated testing environment using ANT and Cucumber-JVM. The problem I'm facing is that we have two systems where we may need to run features against, some features are for landscape1 and some features for landscape2. I was going to use tags to define which scenario is for which landscape, however some features may not necessarily contain a scenario for both landscapes. This proves to be a problem when running cucumber with -tags @landscape1 if there are no scenarios defined then an exception is thrown[java] cucumber.runtime.CucumberException: None of the features at [build/test-classes, src/test/resources] matched the filters: [@landscape1][java] at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:45)   [java] at cucumber.runtime.RuntimeOptions.cucumberFeatures(RuntimeOptions.java:98)   [java] at cucumber.runtime.Runtime.run(Runtime.java:82)   [java] at cucumber.cli.Main.run(Main.java:20)   [java] at cucumber.cli.Main.main(Main.java:12)   [java] Running Shutdown Hook...   [java] Running Shutdown Hook executed!I was wondering if there was any method of telling cucumber not to throw the exception if no tags are found, or performing an initial check to see whether any tags exist first and if they exist run cucumber, if not then skip that feature file..I added this failure mode to help people who screw up their commanx line options, giving them a hint why no features were run.Removing this might help you, but do a disservice to many others.What do people think?