From 1a6e2fc5b1d697d0dbcfb48b657dbd161ecce193 Mon Sep 17 00:00:00 2001 From: Johan Brandhorst-Satzkorn Date: Wed, 1 Nov 2023 21:00:53 -0700 Subject: [PATCH] internal/storage: fix options test An assert created in the parent was being used in subtests, which will attribute test failures incorrectly. Also run tests in parallel. --- internal/storage/options_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/storage/options_test.go b/internal/storage/options_test.go index ebb45bdfc9..a0cb5936bd 100644 --- a/internal/storage/options_test.go +++ b/internal/storage/options_test.go @@ -12,8 +12,9 @@ import ( // Test_getOpts provides unit tests for GetOpts and all the options func Test_getOpts(t *testing.T) { t.Parallel() - assert := assert.New(t) t.Run("WithCloseSyncMode", func(t *testing.T) { + t.Parallel() + assert := assert.New(t) testOpts := getDefaultOptions() opts := GetOpts(WithCloseSyncMode(Asynchronous)) assert.Equal(testOpts, opts) @@ -29,6 +30,8 @@ func Test_getOpts(t *testing.T) { assert.Equal(opts, testOpts) }) t.Run("WithFileAccessMode", func(t *testing.T) { + t.Parallel() + assert := assert.New(t) testOpts := getDefaultOptions() opts := GetOpts(WithFileAccessMode(ReadOnly)) assert.Equal(testOpts, opts) @@ -44,6 +47,8 @@ func Test_getOpts(t *testing.T) { assert.Equal(opts, testOpts) }) t.Run("WithCreateFile", func(t *testing.T) { + t.Parallel() + assert := assert.New(t) testOpts := getDefaultOptions() opts := GetOpts() testOpts.WithCreateFile = false