Skip to content

Commit

Permalink
fix: Use require.NoError when appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
codingllama committed Jan 8, 2025
1 parent b8affe4 commit 96491e3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/integrations/awsoidc/eks_enroll_clusters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func TestEnrollEKSClusters(t *testing.T) {
responseCheck: func(t *testing.T, response *EnrollEKSClusterResponse) {
require.Len(t, response.Results, 1)
require.Equal(t, "EKS1", response.Results[0].ClusterName)
require.Empty(t, response.Results[0].Error)
require.NoError(t, response.Results[0].Error)
require.NotEmpty(t, response.Results[0].ResourceId)
},
},
Expand All @@ -187,10 +187,10 @@ func TestEnrollEKSClusters(t *testing.T) {
return strings.Compare(a.ClusterName, b.ClusterName)
})
require.Equal(t, "EKS1", response.Results[0].ClusterName)
require.Empty(t, response.Results[0].Error)
require.NoError(t, response.Results[0].Error)
require.NotEmpty(t, response.Results[0].ResourceId)
require.Equal(t, "EKS2", response.Results[1].ClusterName)
require.Empty(t, response.Results[1].Error)
require.NoError(t, response.Results[1].Error)
require.NotEmpty(t, response.Results[1].ResourceId)
},
},
Expand Down
2 changes: 1 addition & 1 deletion lib/services/local/access_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ func TestAccessListReviewCRUD(t *testing.T) {

// Verify that access lists reviews are gone.
_, _, err = service.ListAccessListReviews(ctx, accessList1.GetName(), 0, "")
require.Empty(t, err)
require.NoError(t, err)
}

func TestAccessListRequiresEqual(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion lib/services/role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ func TestValidateRole(t *testing.T) {
require.NoError(t, err, trace.DebugReport(err))

if len(tc.expectWarnings) == 0 {
require.Empty(t, warning)
require.NoError(t, warning)
}
for _, msg := range tc.expectWarnings {
require.ErrorContains(t, warning, msg)
Expand Down

0 comments on commit 96491e3

Please sign in to comment.