lively-exabyte-12840
02/25/2022, 1:14 PMdoppler run -- ./pants test path/to/test.py works great (though I still need to configure test/extra_env_vars so that env vars in the Pants env carry over to the env running the tests)enough-analyst-54434
02/25/2022, 1:25 PM./pants test ... + [test] extra_env_vars isn't enough. If ./pants is in the right location to pick up .env (and it's run in a shell with direnv active I'm guessing?), then pants should see those env vars and let them through to test.enough-analyst-54434
02/25/2022, 1:28 PM.env in question in the test/path/to/test.py subtree and not a sibling of ./pants?enough-analyst-54434
02/25/2022, 1:33 PMFOO=bar ./pants test --extra-env-vars=FOO ...enough-analyst-54434
02/25/2022, 1:58 PMdoppler instead of direnv? When I see .env I think direnv, but apparently there are many tools that read .env! Pants is not one. I think I've caught up to your problem finally!lively-exabyte-12840
02/25/2022, 3:35 PMfile(
name="root_env_file",
source=".env",
)
And then I've had to add this to every BUILD file in a test directory:
python_tests(
name="tests0",
dependencies=["//:root_env_file"]
)lively-exabyte-12840
02/25/2022, 3:36 PMenough-analyst-54434
02/25/2022, 3:43 PM.env threw me off. I did not realize doppler didn't use .env. Gotcha.enough-analyst-54434
02/25/2022, 4:28 PM