-
-
Notifications
You must be signed in to change notification settings - Fork 690
Open
Description
Related: #838
The official documentation https://onsi.github.io/ginkgo/#spec-cleanup-aftereach-and-defercleanup promotes the use of os.Setenv to set per-test-case environment variables. This is dangerous, since the environment is per-process, meaning any other tests running in parallel will have the same environment. Go's testing package solved this, providing Setenv since Go 1.17. If used together with t.Parallel, it errors out.
In Ginkgo, one can use something like:
t := GinkgoT()
t.Setenv(newDir)It seems that documentation should document this way, instead of promoting os.Setenv use in tests.
Metadata
Metadata
Assignees
Labels
No labels