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
Allow environment variable substitution in config yaml #22
Comments
I realised this was only a couple of lines of code to do so I have implemented it in this branch https://github.com/taverntesting/tavern/tree/feature/env-var-formatting - not sure what the 'magic' variable name should be for environment variables though? I suppose that it just means people can't save a variable called ENV_VARS |
👍 we'll test it out and let you know of any issues. |
I have tested this branch out and it works very well for me as I am using tox with tox-docker which launches my docker container and leaves an environment variable in the form of for any port listed with EXPOSE in the Dockerfile. So now when tox-docker starts the container, pytest runs with the Tavern plugin I can use the ENV_VARS in the yaml file to get the correct port for the url to test my microservice. Good work 👍 |
With #36 there is going to be a value called |
Allow variables such as sensitive API keys or other auth tokens to be set as environment variables and substituted in config.yaml when parsed at runtime (i.e. with a
$ENV{ENVNAME}
type syntax). This is standard practice for cloud-based CI solutions such a Travis, Circle CI, etc.The text was updated successfully, but these errors were encountered: