[Cucumber-jvm] not able to run cucumber tests from springboot executable jar | backends not found

285 views
Skip to first unread message

Nishant Vashisth

unread,
May 11, 2018, 7:58:19 AM5/11/18
to Cukes
Hi,

I'm trying to create a testing service to run on Openshift and for that I have a spring boot application which initializes a web api.
When called, this API initializes a Cucumber() object with a typical BDDRunner.class which has @CucumberOptions on it.

@CucumberOptions(
        features
= "src/main/resources",
        glue
= "com.processing.bdd",
        tags
= {"@match"})
public class BddRunner {}

After changing the Annotations using Annotation proxy, I run it like so.

Cucumber test = new Cucumber(BddRunner.class);
new JUnitCore().run(test);

But when I run the jar using java -jar feature-runner.jar
It starts up nicely, however, when i hit the API, it says that No Backends were found on CLASSPATH

Normally the springboot jar is a fat jar and has all the dependencies in it already, resources and classes but it doens't recognize them perhaps.

When I tried to add all the libs in the same folder as the feature-runner.jar, it got pass the backends error, but error-ed on the point where it tried to find the features

When i hardcoded the feature path to the full path, it went pass that point but gave error that the steps are not implemented, i.e. it didn't link the features to glue.

This is a gradle project, am I missing any classpath specs in the project?
I have all the glue code and resources in the main package since jar doesn't compile test package.

Please help.

MP Korstanje

unread,
May 12, 2018, 9:17:00 AM5/12/18
to Cukes
It is closely related to the problems in: https://github.com/cucumber/cucumber-jvm/issues/1320

In short, you can't read the contents of spring boot executable jars without using spring boot.

Though I'm a bit puzzled why you'd want to run tests in production.

-MP

Nishant Vashisth

unread,
May 13, 2018, 11:04:22 PM5/13/18
to Cukes
Thanks, I'll try to implement my own resource loader, I thought the problem was around there only but didn't know about spring context.

I'm trying to deploy a service on Openshift which can run scenarios on deployment everytime.

This service is explicitly for running scenarios and doesn't have any code to test as such. It's used to test other microservices.

That's why i need to package in main folder

Reply all
Reply to author
Forward
0 new messages