authelia/internal/configuration
Eng Zer Jun 59c11581b8
test: use testing tempdir tooling (#4468)
This commit replaces `os.MkdirTemp` 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 `os.MkdirTemp`
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>

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: James Elliott <james-d-elliott@users.noreply.github.com>
2022-12-04 20:57:28 +11:00
..
schema refactor: ldap filter (#4329) 2022-11-04 13:42:28 +11:00
test_resources feat(configuration): mtls clients (#4221) 2022-10-21 19:41:33 +11:00
validator fix(configuration): missing warning about session domain (#4417) 2022-11-24 10:16:23 +11:00
config.template.yml refactor: remove pre1 migration path (#4356) 2022-11-25 23:44:55 +11:00
configuration_test.go fix: include major in go.mod module directive (#2278) 2021-08-11 11:16:46 +10:00
const.go fix(configuration): certificate_chains can't be defined as secrets (#4302) 2022-10-31 11:52:14 +11:00
decode_hooks.go feat(configuration): mtls clients (#4221) 2022-10-21 19:41:33 +11:00
decode_hooks_test.go refactor: any (#4133) 2022-10-05 16:05:23 +11:00
deprecation.go refactor: any (#4133) 2022-10-05 16:05:23 +11:00
helpers.go ci: gen github tmpl locales and commitlint (#3759) 2022-09-16 14:21:05 +10:00
helpers_test.go ci: gen github tmpl locales and commitlint (#3759) 2022-09-16 14:21:05 +10:00
koanf_callbacks.go refactor: any (#4133) 2022-10-05 16:05:23 +11:00
koanf_callbacks_test.go test: use testing tempdir tooling (#4468) 2022-12-04 20:57:28 +11:00
koanf_util.go refactor: any (#4133) 2022-10-05 16:05:23 +11:00
koanf_util_test.go feat(configuration): automatically map old keys (#3199) 2022-06-28 13:15:50 +10:00
provider.go feat(configuration): mtls clients (#4221) 2022-10-21 19:41:33 +11:00
provider_test.go test: use testing tempdir tooling (#4468) 2022-12-04 20:57:28 +11:00
sources.go refactor: any (#4133) 2022-10-05 16:05:23 +11:00
template.go feat(configuration): automatically map old keys (#3199) 2022-06-28 13:15:50 +10:00
template_test.go test: use testing tempdir tooling (#4468) 2022-12-04 20:57:28 +11:00
types.go refactor: any (#4133) 2022-10-05 16:05:23 +11:00