Hi all, I am new to tap development and I am usin...
# singer-tap-development
e
Hi all, I am new to tap development and I am using the cookiecutter project. What is the recommended testing flow? I want to use the pytest tests, but obviously dont want to commit my api config to the SAMPLE_CONFIG. How do I supply this key to pytest?
e
Hi @elliot. If you set the tap config values as environment variables, the tests should pick them up automatically.
e
Hi @edgar_ramirez_mondragon, thanks for getting back to me so quickly. Just to get a better idea of your workflow, do you track these in an
.env
file?
and say I had a property called
auth_token
, would this need to be an environment variable called
TAP-<my-source>-AUTH-TOKEN
?
e
Yeah, so during development you'd use the --config=ENV option, so
Copy code
tap-mysource --config=ENV
It will pick up both environment variables and an
.env
if there's one present Now, the test generator overrides this behavior to always look for environment variables: https://github.com/meltano/sdk/blob/2166416c116528924ca0599e59b3db77d3be478e/singer_sdk/testing.py#L13-L43
e
I’ve settled for:
Copy code
poetry run tap-my_tap --config .secrets/config.json
Would have been nice if there was a way to do it with the pytest command, but this will do 🙂 Thanks for your help!