-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.0 release thread #1373
Comments
|
@ptrthomas I had rebuilt the rewrite branch locally and generated karate-2.0.0.jar, and below is test finding:
The same issue also found when I use the karate-2.0.0.jar to run local karate API testing against karate mock server. |
@hujunhaorobert thanks for trying out the I also suspect you may not have switched cleanly to the if you still have trouble, I'll try to get a better way of trying RC releases, but I don't want to release JAR files to maven just yet |
passing JS functions top Java code that will be executed on another thread has to be wrapped using this may still have issues, in that case - last resort is to move the whole flow to Java refer oracle/graaljs#59 |
@ptrthomas Yes, I met some trouble to get standalone karate-{version}.jar for my mock testing. In order to regenerate that JAR, I was following the Developer Guide of Build Standalone JAR and ZIP from https://github.com/intuit/karate/wiki/Developer-Guide. I see there is nothing except README.md under karate-netty now, can you specify how to generate Karate standalone JAR, or how can I get a RC release? Thanks! |
@hujunhaorobert since all the code is in
|
breaking change - but this was the best way to solve the js threading problem
|
@ptrthomas By following your instruction above, I re-generated the karate-2.0.0.jar successfully, which is good. I copy this jar file to my mockTest project, and put my customised karate-config.js file under the mockTest project folder, same as main-mock-server.feature. When I launching my mock server by CLI: The program throw an exception when running below line(11) in main-mock-server.feature
Console log is as below:
I had a quick debugging, and noticed that there was a bug when parsing the path in getResource(path), here the path=classpath:karate-config.js. |
@hujunhaorobert it is likely the previous behavior was a bug. in mocks, there is not really a |
Returning object literal with Example js file:
} Calling the js file's method using
|
Calling Java function using obtained variable raises an error. The following is the sample feature file:
Java file is as below:
The error raised is:
Quite weird considering the data type used is an appropriate one. |
@sumargoraymond for your first comment, I cannot replicate: 263ce53 and regarding the second, |
EDITED: It works well using |
Hi @ptrthomas , can you try outputting 263ce53 with Thanks |
@sumargoraymond you are absolutely right ! thanks :) should be fixed now |
some improvements to the
|
E.g. running
The test runner will run tests with the default annotation ( |
@sumargoraymond this is a tough one. I'm planning to change the way this works. what I propose is:
in fact the code example in the post just above is an example why this is needed. here, that said - if you want to have this flexibility at run time, you have 2 options:
comments from anyone welcome |
@sumargoraymond please ignore what I said above, I remembered that frameworks e.g spring / boot give highest priority to command-line, then system properties - and this is the right way to be able to change things at deployment / ci so I made it work now like it used to, can you please take a look again and confirm and thanks for trying out the early versions like this - it makes things so much easier 👍 |
Sure thing, will do. Thanks @ptrthomas |
@sumargoraymond can you provide the values of the request and response headers, specifically the |
@ptrthomas Edited: I just tried hitting the same request again and it successfully loaded an xml. Yet on the RC the error is still the same:
Cannot seem to find any |
@sumargoraymond unfortunately I can't do anything unless I get some way to replicate, so I'm going to move on to other things. it is possible that your server has a bug and it doesn't support some cookies: https://web.dev/samesite-cookies-explained/ I'm sure you can find a way to replicate. for e.g. * url 'https://httpbin.org/cookies'
* cookie foo = { value: 'bar', samesite: 'Strict' }
* method get
* status 200
* match response == { cookies : { foo: 'bar', SameSite: 'Strict' } }
* url 'https://widget-pixels.outbrain.com/widget/detect/px.gif?ch=1&rn=1.3815335980445032'
* method get
* status 200
* match responseCookies.akacd_widgets_routing.samesite == 'None' |
My bad @ptrthomas , the server does indeed require a certain key value pair for the cookie. After implementing the necessary cookie on the header, it works well on RC. |
@ivangsa does this answer your question ? https://twitter.com/KarateDSL/status/1305144489523048448 |
@ptrthomas yess, we knew this but didn't make the association yet.. thank you! |
@ivangsa awesome. also the same trick works for the to everyone listening - there are SO many changes that I'm not sure if I can add all of those to the readme :( |
I'm seeing an undesirable warning when my feature calls another feature which happens to use the same variable name. I have 2 feature files:
Functionally, this works as expected. When
This warning was troubling at first as it made me suspect that a variable could be accidentally overwritten if a called feature happens to use the same variable name. Fortunately it turns out that is not the case, but I do not believe I should be seeing this warning. |
@Lorkenpeist I'm going to keep it as it is - but you are welcome to submit a PR. any variable in a calling feature "exists" in called features no matter if it is "shared" or "isolated". |
Has this error emerged yet?
|
@lhimo no and it seems to be something you are doing wrong. follow this process please: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue |
Hi, I was just trying to test my suites with the 0.9.9.RC4 (2021-02-09) Standalone JAR. I built the jar file following the Developer-Guide and everything was looking good, but when running the scenarios there are errors with the karate-config.js file, especially when reading files. These errors are not present using the standalone jar from v0.9.6.
|
@ricardgo403 I think using the |
Hi, --watch option is not supported anymore when starting mocks?
I've tried with |
also in RC4, I'm not sure if it worked before, karate expressions are replaced ok in inlined json and json files but they are not replaced in yml files |
@ivangsa yes, watch is gone. and I don't think we ever supported yaml embedded expressions |
ah ok, I though that yml and json where treated mostly the same.. |
@ivangsa nope, we designed for json / xml only |
Has the Code: var signIn = karate.callSingle(karate.properties['karate.config.dir'] + '/features/authentication/authentication.feature', config); Is now throwing
If I comment this out and log what's passed in it seems fine karate.log("Config dir = ", karate.properties['karate.config.dir'] + '/features/authentication/authentication.feature'); Returns
Which is where my feature file is. I'm running with the JAR file (Windows) as follows
And it works on 0.9.6 |
@JoshSchreuder certainly can be a bug. the BEST thing you can do is follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue |
@ptrthomas 👍 I'll try and put together a minimal project that reproduces this for you EDIT: might be similar to #1480 perhaps. |
@ptrthomas , I created a repo https://github.com/hujunhaorobert/demoMockFailure to replicate the failure mentioned in #1480 (java.lang.NullPointerException). Could you please have a look? |
@ptrthomas I re-generate karate-2.0.0.jar based on the latest develop branch and re-run the mock testing, seems the reported error is gone. Thanks for your effort on the fix solution! |
@sumargoraymond if you or anyone can fix or at least replicate that will be great, I'm going to treat this as low priority. I also don't remember if the logger needs to be |
Hi @ptrthomas . It works perfectly on DEBUG. Thanks a lot! |
@ptrthomas on that image - I'd recommended adding the |
@joelpramos there's already a section on the wiki: https://github.com/intuit/karate/wiki/1.0-upgrade-guide#java-in-js and if within JS folks should use |
this issue is to provide updates and collect feedback. also will hold some images needed for the wiki
this wiki page will hold details: https://github.com/intuit/karate/wiki/1.0-upgrade-guide
The text was updated successfully, but these errors were encountered: