Commit 46b87e5
committed
Adding
This is one approach for improving `bats_test` environment variable expansion logic (to get at least parity with built-in expansion logic).
See https://github.com/CauhxMilloy/bazel-bats/tree/improvedExpansionWithShTest for `sh_test` approach.
* Adding `expansion.bzl` directly to this project.
* Allows for better environment variable expansion than built-in skylark methods.
* I'm also trying to submit this to Skylib (bazelbuild/bazel-skylib#486).
* I could add this here (instead or in addition to).
* Obviously, (also) adding this to Skylib would be more reusable for more repos.
* Once submitted to Skylib (if accepted), this addition of `expansion.bzl` could be replaced with referencing the one in Skylib.
* Doing this would add an extra dependency for bazel-bats (needing to pull in Skylib in `bazel_bats_dependencies()`).
* Alternatively, could just keep this file here (for no extra dependency).
* Updating `env` attribute expansion logic in `_bats_test_impl()`.
* Allows better environment expansion logic than previously used.
* Updating `tests/hello_world.bats` to validate many different environment variable expansion configurations.expansion.bzl for Improved Env Var Expansion1 parent 4aa002f commit 46b87e5
4 files changed
+851
-22
lines changed
0 commit comments