Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bazel config. #8

Merged
merged 13 commits into from
Jan 14, 2024
Prev Previous commit
Next Next commit
Color pytest output
  • Loading branch information
dougthor42 committed Jan 14, 2024
commit 052a64ec8e4e49f8decca76386ed9d2812855cb8
14 changes: 9 additions & 5 deletions tools/bazel/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@ def pytest_test(name, srcs, deps, **kwargs):
main = shim,
# TODO: What's this 'location'?
args = ["$(location {})".format(src) for src in srcs],
# Within bazel, `$HOME` is typically set to $TEST_TMPDIR`, but it looks
# like there's a bug? https://github.com/bazelbuild/bazel/issues/10652
# So we inject it manually.
# TODO: Don't point to root, point to $TEST_TMPDIR instead.
env = {"HOME": "/"},
env = {
# Within bazel, `$HOME` is typically set to $TEST_TMPDIR`, but it looks
# like there's a bug? https://github.com/bazelbuild/bazel/issues/10652
# So we inject it manually.
# TODO: Don't point to root, point to $TEST_TMPDIR instead.
"HOME": "/",
# Force pytest to always color output.
"PYTEST_ADDOPTS": "--color=yes",
},
deps = deps,
**kwargs,
)
Loading