// MkdirTemp is a helper function which creates a temporary directory,
// and they are automatically removed after test is completed
t.Helper()
tempDir, err := os.MkdirTemp(dir, pattern)
require.NoError(t, err)
require.NotNil(t, tempDir)
t.Cleanup(func() { require.NoError(t, os.RemoveAll(tempDir)) })
return tempDir
}