fresh-mechanic-68429
01/23/2024, 5:04 AMEnvironmentVarsRequest
env_vars = await Get(EnvironmentVars, EnvironmentVarsRequest(("HOME",)))
process_request = Process(
...
env = {
"HOME": env_vars.get("HOME"),
},
)
result = await Get(FallibleProcessResult, Process, process_request)
But while testing under pants, this env var wasn’t available by default (unknown to me) and the test just kinda hung forever? The little spinner just keeps going and going
Eventually I figured out I needed to add the var to the pants toml
[test]
extra_env_vars = [
"HOME"
]
Or change the get to "HOME": env_vars.get("HOME", ""),
Is there somewhere else I should’ve been checking for logs? I tried setting the log level like this but didn’t see anything extra
rule_runner.set_options(
["-ltrace"],
env_inherit={"PATH", "HOME"},
)
fresh-mechanic-68429
01/23/2024, 5:06 AMNone
when creating the process
env = {
"HOME": None,
}
If I execute the same thing outside a test, I get an infinite loop of
[INFO] Filesystem changed during run: retrying `@rule(...)` in 500ms...
happy-kitchen-89482
01/23/2024, 5:09 AMhappy-kitchen-89482
01/23/2024, 5:09 AMfresh-mechanic-68429
01/23/2024, 2:26 PM