bazel
bazel copied to clipboard
Expose inherited part of action environment to Starlark tests
Starlark tests can use the new Action#inherited_env
field to get a list of environment variables the action inherits from the client environment, obtained from AbstractAction#getClientEnvironmentVariables
.
@rickeylev Could you take a look? I found this capability to be lacking while working on analysis tests for cc_static_library
and noticing that using use_default_shell_env
has pitfalls.
I missed that this PR is waiting for me. Is there still interest to get it in?
This is exposing Action.env_inherit, which is only accessible to tests, right? And that's suppose to make the tests more robust, IIUC?
I missed that this PR is waiting for me. Is there still interest to get it in?
Yes.
This is exposing Action.env_inherit, which is only accessible to tests, right? And that's suppose to make the tests more robust, IIUC?
Exactly, this API is test only. Currently tests can't assert on the inherited environment at all.
The wait was worth it, this is much simpler now.
@comius Getting this into 7.2.0 would make it easier to write tests for cc_static_library
.