The high level overview is what led me there: <htt...
# general
e
m
I tried that, but I think the problem is, that the environment variable is already defined in
env_vars_devcontainer()
and this overrides whatever value I decalre for it in
test_extra_env_vars
.
e
If so, that sounds like a bug. If you drop use of environments (just using local is like not using them), it should be the case that plain old test extra_env_vars overrides subprocess_environment env_vars.
m
Here ist says that: "Any fields that are defined in that environment will override the values from options set by
pants.toml
, command line values, or environment variables." To me this sounds like the environment variables defined in my "local" environment will override anything that is set somewhere else. Or am I misinterpreting this sentence? But if this is indeed a bug, I will file an issue.
e
I don't think I'm being clear. So forget environments for a second. In plain old pants you have (for Python)
[subprocess-environment] env_vars
which applies to all Python subprocess and
[test] extra_env_vars
which overlays that but just for test subprocesses. Now pulling environments back in, the local environment has a mirror of both of those same options. Using the equivalent pair of options there should have the equivalent overlay effect.
Really, unless you plan on using Environments other than a single local environment, they're probably just buying you confusion. Environments really only make sense when you define more than one.
m
I have more than one, since one test needs to run in its own docker container, therefore, I think the usage of environments makes sense for me. I just wanted to give a simple overview what I wanted to to so I left out this detail.
e
Ok, great.
So the environment-specific test extra_env_vars option not overlaying the environment-specific subprocess-environment env_vars option is a behavior divergence from plain old Pants and a bug.