powerful-scooter-95162
03/19/2024, 8:51 PMdoppler run pants...
and also requires allowlisting all the env vars in pants (right?)chilly-cricket-5423
03/19/2024, 8:54 PM[test]
extra_env_vars = [ ... ]
And run pants inside docker or a wrapper that set the env vars from secretspowerful-scooter-95162
03/19/2024, 9:04 PMchilly-cricket-5423
03/19/2024, 9:09 PMpowerful-scooter-95162
03/19/2024, 9:10 PMcurved-hydrogen-24259
03/20/2024, 12:49 PMpytest.ini
. Best option probably depends (like everything), but for me it's nice because
• those env vars obviously are valid only in test runs
• having secrets there visible shouldn't be an issue, as test env should be isolated in any case
• I can see all env vars that need to be set for tests to work in one place, and
• ....it kindly suggest people should use more powerful pytest instead of vanilla unit test suite 😉
• it can be included as-is in Docker
if you really need dynamic secrets in test env though, I'd consider either just reading those secrets in code if possible, or maybe use some other tool to substitute env var in pytest.ini
, say %%myenv%%
and a tool that replaces that string before deploying it with doppler secrets?