rules_js icon indicating copy to clipboard operation
rules_js copied to clipboard

[FR]: support env_inherit attr on js_test

Open yaroslavvoloshchuk-codaio opened this issue 2 years ago • 1 comments

What is the current behavior?

So far, we have only one way to pass the subset of environment variables to the js_test target - by using --test_env=ENV_VAR. However, those variables are defined globally for all test targets, so when they change, they invalidate the cache of all tests.

Describe the feature

It would be great to add support for env_inherit described here: https://bazel.build/reference/be/common-definitions#common-attributes-tests. Then it would allow us to specify which env variables should be passed into tests per target level.

Implementation example: https://github.com/bazelbuild/rules_go/pull/3256/files#diff-2f4977ebad0d8fd012c0d532023ebe9202e795bf502029f7df454d5fc4f96656

https://docs.aspect.build/rulesets/aspect_rules_js/docs/js_binary#js_test currently states "All common test attributes are supported", but without support for env_inherit that is not the case.

WillMorrisonEnspi avatar Aug 20 '24 11:08 WillMorrisonEnspi