authelia/internal
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
..
authentication fix(authentication): erroneously escaped group base dn (#4288) 2022-10-28 20:21:43 +11:00
authorization feat(authorization): query parameter filtering (#3990) 2022-10-19 14:09:22 +11:00
commands refactor: remove pre1 migration path (#4356) 2022-11-25 23:44:55 +11:00
configuration test: use testing tempdir tooling (#4468) 2022-12-04 20:57:28 +11:00
duo fix(notification): text emails not encoded properly (#3854) 2022-08-27 07:39:20 +10:00
handlers build(deps): update module github.com/ory/fosite to v0.43.0 (#4269) 2022-11-13 14:26:10 +11:00
logging test: use testing tempdir tooling (#4468) 2022-12-04 20:57:28 +11:00
metrics refactor(metrics): simplify names (#3515) 2022-06-14 21:51:33 +10:00
middlewares fix(oidc): handle authorization post requests (#4270) 2022-10-26 19:14:43 +11:00
mocks refactor: remove pre1 migration path (#4356) 2022-11-25 23:44:55 +11:00
model fix(storage): schema inconsistency (#4262) 2022-11-19 16:47:09 +11:00
notification feat(configuration): mtls clients (#4221) 2022-10-21 19:41:33 +11:00
ntp refactor(configuration): utilize time duration decode hook (#2938) 2022-03-02 17:40:26 +11:00
oidc build(deps): update module github.com/ory/fosite to v0.43.0 (#4269) 2022-11-13 14:26:10 +11:00
regulation feat(metrics): implement prometheus metrics (#3234) 2022-06-14 17:20:13 +10:00
server fix(oidc): handle authorization post requests (#4270) 2022-10-26 19:14:43 +11:00
session feat(configuration): mtls clients (#4221) 2022-10-21 19:41:33 +11:00
storage refactor: remove pre1 migration path (#4356) 2022-11-25 23:44:55 +11:00
suites build(deps): update haproxy docker tag to v2.7.0 (#4459) 2022-12-02 00:59:33 +00:00
templates fix(notification): text emails not encoded properly (#3854) 2022-08-27 07:39:20 +10:00
totp feat(totp): secret customization (#2681) 2022-04-08 09:01:01 +10:00
utils test: use testing tempdir tooling (#4468) 2022-12-04 20:57:28 +11:00