From e3204a4eb9cfaf71b61b82707d0c68ef6e1c995b Mon Sep 17 00:00:00 2001 From: Arthur Date: Tue, 12 Nov 2024 16:59:16 +0800 Subject: [PATCH] add resource error type and message check for ListAll test --- flyteadmin/pkg/manager/impl/resources/resource_manager_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flyteadmin/pkg/manager/impl/resources/resource_manager_test.go b/flyteadmin/pkg/manager/impl/resources/resource_manager_test.go index 66c8259850c..0537ef4a85c 100644 --- a/flyteadmin/pkg/manager/impl/resources/resource_manager_test.go +++ b/flyteadmin/pkg/manager/impl/resources/resource_manager_test.go @@ -969,6 +969,9 @@ func TestListAllResources(t *testing.T) { ResourceType: admin.MatchableResource_CLUSTER_RESOURCE, }) assert.Error(t, resourceError) + var newError errors.FlyteAdminError + assert.ErrorAs(t, resourceError, &newError) + assert.Equal(t, newError.Error(), "resourceError") db.ResourceRepo().(*mocks.MockResourceRepo).ListAllFunction = func(ctx context.Context, resourceType string) ( []models.Resource, error) {