callonce feature not working properly
See original GitHub issueHi Peter!
I am having a quite nice experience with Karate so far, thanks for the continued effort! 😃
I am working with a feature with the following design:
Background:
* def xyz = callonce read('classpath:abc.feature')
* configure headers = read('headers.js')
Scenario: Does something
Scenario: Does something else
Let’s say abc.feature it is a feature that authenticates my user and sets headers accordingly. From the execution logs, I am seeing:
...
cached callonce: read('classpath:abc.feature')
...
But the abc.feature is being invoked continuously, before each and every Scenario. From the ‘callonce’ standpoint, I guess it is not correct, this is causing me to hit the authentication endpoint unnecessarily. I am using karate 0.3.1.
Best,
Neill
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Karate - callonce feature doesn't cache the response
1 Answer 1 ... It must be because you are using the IDE support / right-click / "run-as" option. This is an open...
Read more >Prevent loop when callonce is calling itself #1669 - GitHub
I'm working with karate-1.0.1.jar and calling it as follows: java -jar karate-1.0.1.jar -C -T 1 my.feature Not sure if I found a bug...
Read more >karate.callSingle() feature in Karate Framework| Part 14
This video talks about the Karate Hooks concept - karate.
Read more >Karate Demo - GitHub Pages
Shows how to dynamically create a JSON array and then use it to call a *.feature file in a loop. In this example,...
Read more >std::call_once - cppreference.com
If concurrent calls to call_once pass different functions f , it is unspecified which f will be called. The selected function runs in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@neillfontes that looks perfect actually. I may actually modify the doc / examples along these lines !
@ptrthomas. It worked fine now.
I’ve adopted the folder structure below. Any objections or recommendations? feature1 and feature2 call the common-whatever.feature in this case, and the cached callonce works well.