opentofu/internal/command/e2etest
Eng Zer Jun fedd315275
test: use T.TempDir to create temporary test directory (#30803)
This commit replaces `ioutil.TempDir` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `ioutil.TempDir`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-04-08 17:34:16 +01:00
..
testdata command/e2etest: TestProviderTampering 2021-10-05 10:59:59 -07:00
.gitignore Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
automation_test.go test: use T.TempDir to create temporary test directory (#30803) 2022-04-08 17:34:16 +01:00
doc.go Update various non-code references to renamed Go packages 2021-05-17 14:09:07 -07:00
init_test.go test: use T.TempDir to create temporary test directory (#30803) 2022-04-08 17:34:16 +01:00
main_test.go build: Build and run e2etest as part of the release build pipeline 2022-01-05 14:31:04 -08:00
make-archive.sh build: Build and run e2etest as part of the release build pipeline 2022-01-05 14:31:04 -08:00
primary_test.go test: use T.TempDir to create temporary test directory (#30803) 2022-04-08 17:34:16 +01:00
provider_dev_test.go test: use T.TempDir to create temporary test directory (#30803) 2022-04-08 17:34:16 +01:00
provider_plugin_test.go test: use T.TempDir to create temporary test directory (#30803) 2022-04-08 17:34:16 +01:00
providers_mirror_test.go test: use T.TempDir to create temporary test directory (#30803) 2022-04-08 17:34:16 +01:00
providers_tamper_test.go test: use T.TempDir to create temporary test directory (#30803) 2022-04-08 17:34:16 +01:00
provisioner_plugin_test.go test: use T.TempDir to create temporary test directory (#30803) 2022-04-08 17:34:16 +01:00
provisioner_test.go test: use T.TempDir to create temporary test directory (#30803) 2022-04-08 17:34:16 +01:00
remote_state_test.go test: use T.TempDir to create temporary test directory (#30803) 2022-04-08 17:34:16 +01:00
strip_ansi.go Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
unmanaged_test.go test: use T.TempDir to create temporary test directory (#30803) 2022-04-08 17:34:16 +01:00
version_test.go test: use T.TempDir to create temporary test directory (#30803) 2022-04-08 17:34:16 +01:00