Karate-Netty version 0.9.2
Whenever my karate-config.js
evaluation fails it prints:
16:49:28.753 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - evaluation of 'karate-config.js' failed: javascript function call failed: unexpected 'configure' key: 'followRedirectss'
16:49:28.761 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - javascript function call failed: unexpected 'configure' key: 'followRedirectss'
16:49:28.762 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - failed function body: function fn(){
<< MY SUPER AMAZING SCRIPT HERE >>
}
Note here I made if fail on purpose with trivial error just to provoke it ^
After the error it would print it for every scenario in every feature file I have, so having 55 feature files with 304 scenarios and karate-config.js with 104 lines you can imagine that this gets bad very fast.
So karate-config 5 lines long with intentional fail + 2 features with single scenario look something like this:
Generating a RSA private key
.+++++++++++++++++++++++++++
...+++++++++++++++++++++++++++
writing new private key to 'key.pem'
-----
17:06:36.217 [main] INFO com.intuit.karate.netty.Main - Karate version: 0.9.2
17:06:36.426 [main] INFO com.intuit.karate.Runner - Karate version: 0.9.2
17:06:37.434 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - javascript function call failed: unexpected 'configure' key: 'followRedirectss'
17:06:37.435 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - failed function body: function fn(){
karate.configure('followRedirectss', false);
// imagine having additional ~100 lines here
// and additional 54 features
}
17:06:37.436 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - evaluation of 'karate-config.js' failed: javascript function call failed: unexpected 'configure' key: 'followRedirectss'
17:06:37.554 [pool-1-thread-1] INFO com.intuit.karate.Runner - <<fail>> feature 1 of 2: src/features/null/null.feature
---------------------------------------------------------
feature: src/features/null/null.feature
report: target/src.features.null.null.json
scenarios: 1 | passed: 0 | failed: 1 | time: 0.0000
---------------------------------------------------------
17:06:37.584 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - javascript function call failed: unexpected 'configure' key: 'followRedirectss'
17:06:37.585 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - failed function body: function fn(){
karate.configure('followRedirectss', false);
// imagine having additional ~100 lines here
// and additional 54 features
}
17:06:37.586 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - evaluation of 'karate-config.js' failed: javascript function call failed: unexpected 'configure' key: 'followRedirectss'
17:06:37.589 [pool-1-thread-1] INFO com.intuit.karate.Runner - <<fail>> feature 2 of 2: src/features/null/null.1.feature
---------------------------------------------------------
feature: src/features/null/null.1.feature
report: target/src.features.null.null.1.json
scenarios: 1 | passed: 0 | failed: 1 | time: 0.0000
---------------------------------------------------------
Karate version: 0.9.2
======================================================
elapsed: 1.16 | threads: 1 | thread time: 0.00
features: 2 | ignored: 0 | efficiency: 0.00
scenarios: 2 | passed: 0 | failed: 2
======================================================
failed features:
src.features.null.null: null.feature:3 - evaluation of 'karate-config.js' failed: javascript function call failed: unexpected 'configure' key: 'followRedirectss'
src.features.null.null.1: null.1.feature:3 - evaluation of 'karate-config.js' failed: javascript function call failed: unexpected 'configure' key: 'followRedirectss'
Exception in thread "main" picocli.CommandLine$ExecutionException: there are test failures
at com.intuit.karate.netty.Main$1.handleExecutionException(Main.java:133)
at picocli.CommandLine.parseWithHandlers(CommandLine.java:1157)
at com.intuit.karate.netty.Main.main(Main.java:139)
Any way to avoid this and to have fail on karate-config.js cause run to stop all together?