Replies: 3 comments 3 replies
-
Hey @nevesb, which version of Benthos are you running? It's possible that this has been fixed as I've tried to reproduce it and it's working as intended, put an example up here: https://github.com/benthosdev/benthos/blob/main/config/test/env_var_stuff.yaml |
Beta Was this translation helpful? Give feedback.
-
Whoops, thanks for the feedback, I missed that it was the linting step before tests being applied causing it. I've disabled env var interpolation checks for unit tests: e62bceb |
Beta Was this translation helpful? Give feedback.
-
This still fails, if the variable is used somewhere in template where its absence would cause a wrong template. input:
http_client:
url: ${my_url_with_token}
verb: GET
processors:
- mapping: |
root = {"id": ${MYID}}
tests:
- name: input tokens
target_processors: '/input/processors'
environment:
my_url_with_token: http://dummyurl.com/
MYID: 123 $ benthos test ./test.yaml
Test 'test.yaml' failed
Failures:
--- test.yaml ---
Lint: (8,31) expected query, got: }
exit status 1 $ MYID=123 benthos test ./test.yaml
Test 'test.yaml' succeeded |
Beta Was this translation helpful? Give feedback.
-
Hello, I started using bethos a while ago and now I'm passing some parameters through environment variables. So for example I have this code snippet in my config:
When I run my tests now the following error message appears:
I tried to run configure my environment variable in several ways, for example:
But no way i put it, it accepts my variable. I think I'm using this field incorrectly. How should I put this?
Beta Was this translation helpful? Give feedback.
All reactions