rules_go icon indicating copy to clipboard operation
rules_go copied to clipboard

go_test: Set $HOME to value of $TEST_TMPDIR

Open stevebarrau opened this issue 2 years ago • 1 comments

What version of rules_go are you using?

0.41.0

What version of Bazel are you using?

6.3.2

What operating system and processor architecture are you using?

macOS arm64

What did you do?

Write a go_test fo some feature in go that uses the user HOME.

What did you expect to see?

The rules_go test runner to follow the recommandation of https://bazel.build/reference/test-encyclopedia and set $HOME to the value of $TEST_TMPDIR.

What did you see instead?

The $HOME env var is not defined.

stevebarrau avatar Sep 14 '23 16:09 stevebarrau

We would welcome a contribution for this. It could probably go into the template used in https://github.com/bazelbuild/rules_go/blob/master/go/tools/builders/generate_test_main.go.

fmeum avatar Sep 15 '23 06:09 fmeum