Only forward LocalAppData when it is defined
Let's see if this works.
added forwarding LocalAppData variable to bazelisk, but it appears it's not defined in our workers. Let's only add it when it exists.
@@ -550,7 +550,10 @@ def execute_commands(
try:
# If the CI worker runs Bazelisk, we need to forward all required env variables to the test.
# Otherwise any integration test that invokes Bazel (=Bazelisk in this case) will fail.
- test_env_vars = ["LocalAppData"] if platform == "windows" else ["HOME"]
+ if platform == "windows" and "LocalAppData" in os.environ:
+ test_env_vars = ["LocalAppData"]
+ else:
+ test_env_vars = ["HOME"]
if git_repo_location:
os.chdir(git_repo_location)
elif git_repository:
