client/pkg/serving
Eng Zer Jun 736c7c24ef
test: use `T.TempDir` to create temporary test directory (#1660)
* 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>

* docs: update CHANGELOG.adoc

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-04-21 11:53:30 +00:00
..
v1 test: use `T.TempDir` to create temporary test directory (#1660) 2022-04-21 11:53:30 +00:00
v1alpha1 Changing the Default retry value (#1463) 2021-10-01 07:56:07 -07:00
config_changes.go Added scale-metric flag to configure metric name (#1653) 2022-04-18 09:15:12 +00:00
config_changes_test.go Added scale-metric flag to configure metric name (#1653) 2022-04-18 09:15:12 +00:00
revision_template.go Fixed panic when traffic split to unavailable revision (#1533) 2021-11-30 07:06:09 -08:00
revision_template_test.go Fixed panic when traffic split to unavailable revision (#1533) 2021-11-30 07:06:09 -08:00
service.go Enable gosec linter and fix existing issues (#1228) 2021-02-16 02:17:26 -08:00
service_test.go Upgrade a few assorted dependencies (#1220) 2021-02-12 05:55:50 -08:00