pulumi/pkg/backend/filestate
Eng Zer Jun 48eff4676a
test: use T.TempDir to create temporary test directory
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-12-03 15:17:08 +08:00
..
backend.go Qualify name 2022-11-29 14:07:20 -08:00
backend_test.go test: use T.TempDir to create temporary test directory 2022-12-03 15:17:08 +08:00
bucket.go Ensure filestate stack.json file are atomically replaced (#9122) 2022-03-08 11:21:39 +00:00
bucket_test.go ci: radical idea - what if slow tests & no stdout makes GH consider runner dead? 2022-03-06 14:52:13 -08:00
crypto.go Assume configFile is non-empty 2022-10-07 14:03:20 +02:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
lock.go Improve lock error for filestate (#10422) 2022-08-17 21:27:04 +01:00
snapshot.go Readd "Make StackReference.Name a tokens.Name (#9088)" (#9236) 2022-03-17 21:37:11 +00:00
stack.go Move default secret manager to stack (#10423) 2022-08-18 15:31:34 +01:00
state.go Add getOrganization to nodejs and python (#10504) 2022-08-31 10:33:29 +01:00