-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: ensure that tests restore env-var values (#11309)
Fix a test corruption issue, where a test accidentally unsets the `NOMAD_LICENSE` environment variable, that's relied on by some tests. As a habit, tests should always restore the environment variable value on test completion. Golang 1.17 introduced [`t.Setenv`](https://pkg.go.dev/testing#T.Setenv) to address this issue. However, as 1.0.x and 1.1.x branches target golang 1.15 and 1.16, I opted to use a helper function to ease backports.
- Loading branch information
Mahmood Ali
authored
Oct 13, 2021
1 parent
6852f21
commit ff1b2f7
Showing
3 changed files
with
25 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters