You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
karate will also look for a file karate-config-<env>.js where env is the value of karate.env
the default dir where this will be looked for is ~/.karate so that this file will never be checked into scm by mistake, so sensitive 'secrets' can go here
this 'over-ride' file will merge the JSON returned with what was returned by karate-config.js. values in the karate-config-<env>.js will "win"
we will support an additional command-line property called karate.config.dir. if present, karate will look here FIRST for both the karate-config.js and the 'over-ride' file. loading from classpath:karate-config.js will continue to work. but only one karate-config.js will be processed. this additional mechanism is expected to make it simpler for CI jobs to over-ride config.
good to have: support a -Dkarate.options="-a foo=bar -a ban=baz" way to over-ride config properties via the command line, aligned with the standalone jar command-line syntax
related to the above, I'm not keen on auto-adding any system property to the config 'property bag' for multiple reasons (clutters the config, may break existing behavior, too much magic)
instead framework developers can always call java.lang.System.getProperty('your.name') and plug them into the config if really needed. for example invent a custom strategy that any system property starting with overwatch. e.g. overwatch.foo=bar would be injected into the config as { foo: 'bar' }
The text was updated successfully, but these errors were encountered:
whoa, on second thoughts, changing second point to be NOT a global path because there will obviously be many karate projects on the same machine !
the default dir where this will be looked for is ${project.basedir}/.karate so that this file will never be checked into scm by mistake, so sensitive 'secrets' can go here
Also wondering if the karate.config.dir can be over-ridable withinkarate-config.js itself, for e.g. with an additional API on the karate JS object
karate.config.dir can set the dir in which config files will be looked for
if karate.env is set, karate-config-<env>.js will be looked for in the config dir which defaults to .karate in working dir
working dir should be the maven project base dir / or within the root
so teams can keep env over-rides in this one file
here's what I'm thinking:
karate-config-<env>.js
whereenv
is the value ofkarate.env
~/.karate
so that this file will never be checked into scm by mistake, so sensitive 'secrets' can go herekarate-config.js
. values in thekarate-config-<env>.js
will "win"karate.config.dir
. if present, karate will look here FIRST for both thekarate-config.js
and the 'over-ride' file. loading fromclasspath:karate-config.js
will continue to work. but only onekarate-config.js
will be processed. this additional mechanism is expected to make it simpler for CI jobs to over-ride config.-Dkarate.options="-a foo=bar -a ban=baz"
way to over-ride config properties via the command line, aligned with the standalone jar command-line syntaxjava.lang.System.getProperty('your.name')
and plug them into the config if really needed. for example invent a custom strategy that any system property starting withoverwatch.
e.g.overwatch.foo=bar
would be injected into the config as{ foo: 'bar' }
The text was updated successfully, but these errors were encountered: