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
karate 1.4.1- Dynamic property ( set in runner) not overridden from maven command #2474
Comments
probably related to #2444 - contributions welcome |
this appears to be from this change. if the preference should be the JVM system properties over the ones configured by the builder, then a fix could be to switch back that part of the change in the runner. |
@dvargas46 I'm unable to figure this out by reading the code, maybe needs some debugging |
@ptrthomas just tried debugging it and this does appear to be the issue from what I could tell. going from systemProperties.putAll(new HashMap(System.getProperties())); to this Map temp = new HashMap(System.getProperties());
temp.putAll(systemProperties); // make sure user-specified takes precedence
systemProperties = temp; reverses the previous behavior. I.e., now the I think most would expect the jvm props to take precedence, at least from my experience. Let me know and I can put out a small PR to bring back the old behavior here. |
@dvargas46 thanks, yes please do proceed with a PR |
fix system properties issue on runner #2474
karate 1.5.0.RC3 including this fix is now available |
I tested this out against 1.5.0RC3 and still seeing the issue. Changes made to POM in earlier attached project- Updated the karate version and group Id.
Ran the same command provided earlier and still seeing username and password being picked from runner and not being overridden. |
Yes, it looks like some changes were made after my PR that brought back the issue. @ptrthomas , I can create another PR that should fix the core issue here while retaining the new changes made. Or would you prefer to wait until after 1.5.0 is released? |
@dvargas46 thanks, apologies since I may have broken it with some other changes to the runner / suite part. please go ahead with another PR, there will be at least one more RC release of 1.5.0 before final |
Attached is the repo to reproduce the issue.
Details:-
Execute below maven command-
mvn test -Dtest=ExamplesTest -Dkarate.username=UsernamefromCmd -Dkarate.password=PasswordfromCmd
check the payload for the API call in summary report. Username and password value is being picked from runner.
Payload is using correct value of username and password i.e. values passed in the maven command.
Attaching the screenshot showing payload for 1.4 and 1.4.1.
karatePropertyOverride.zip
The text was updated successfully, but these errors were encountered: