karate
karate copied to clipboard
Runner.runFeature returning null causing load test to crash
I recently updated the version of karate I'm using from version 1.0.0 to 1.1.0. After upgrading I noticed my gatling load test is crashing. I believe the test is failing due to Runner.runFeature returning a null value.
I have attached a minimal sample project that can be used to reproduce the issue I am seeing.
To reproduce:
Unzip attached example project.
Verify karate.version in pom.xml has version 1.1.0.
Run command mvn test-compile gatling:test
in the root of the project
Result:
You will see null pointer exception. The result from this code appears to return a null, crashing the test.
Map<String,Object> result = Runner.runFeature("classpath:token/GetAuthToken.feature", account, true);
If you revert the karate.version in the pom.xml to 1.0.0 and re-run the command to kick off the test you will see the test runs successfully.
@ptrthomas @baharford in attached zip, the file GetAuthToken.feature contains @ignore tag on the feature. On removing ignore tag, tests ran fine. https://github.com/karatelabs/karate#special-tags Am I missing something ?
yes karate 1.1.0 auto-excludes the @ignore
tag: https://github.com/karatelabs/karate#special-tags
maybe this behavior should not apply to Runner.runFeature()
.
that said - my opinion is Runner.runFeature()
is an old API that should not be used in tests, I haven't looked at the code yet, but I'd like to know why a proper gatling karateFeature()
can't be used
Thanks for the info. It makes sense now why after upgrading to v1.1.0 the Runner.runFeature is returning null. I'll work on updating my gatling simulation to try to use karateFeature()
@baharford yes any analysis will help, I'm okay to make the fix to runFeature()
- but I'm also keen to make the gatling integration more "usable". do read through this also for reference: https://stackoverflow.com/a/69223217/143475
yes karate 1.1.0 auto-excludes the
@ignore
tag: https://github.com/karatelabs/karate#special-tagsmaybe this behavior should not apply to
Runner.runFeature()
.that said - my opinion is
Runner.runFeature()
is an old API that should not be used in tests, I haven't looked at the code yet, but I'd like to know why a proper gatlingkarateFeature()
can't be used
I faced the same issue on Java and Karate-core
1.1.0 - The Above comment helps me. Before I had @ignore
tag in each feature
fixed in develop
1.3.0 released