-
-
Notifications
You must be signed in to change notification settings - Fork 717
feat(script): Environment field in custom/script #2512
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
Conversation
Returns a list of key-value pairs starting with a prefix. If you have in config: ``` env-FOO = bar env-CAT = dog ``` then `get_with_prefix("env-")` will return `[{"FOO", "bar"}, {"CAT", "dog"}]`
@patrick96 I have a question. How do I test a new config option? |
Do you mean adding unit tests for it? There isn't really any infrastructure for that unfortunately. I think it's fine doing this without tests for now. At some point we should write some code that allows us to easily construct config instances with certain given values. |
Codecov Report
@@ Coverage Diff @@
## master #2512 +/- ##
==========================================
+ Coverage 10.10% 10.22% +0.12%
==========================================
Files 147 145 -2
Lines 10235 10110 -125
==========================================
Hits 1034 1034
+ Misses 9201 9076 -125
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Before passing the cmd to exec() we set the required environment variables. Also add the test for it.
This stores the key-value pairs specified for the script module. The command to be executed must pass on this argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice. With tests even 🎆
I went ahead and modified the config loading a bit by templating the value type. Otherwise everything else looks good.
Thanks a lot 😃
What type of PR is this? (check all applicable)
Description
This PR wil add the
env-*
config option in the script moduleRelated Issues & Documents
Fixes #2090.
Documentation (check all applicable)
Document the
env-*
option for the 'script' module in the wiki.