Skip to content

Commit

Permalink
align testCases variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyulin0719 committed Aug 27, 2024
1 parent b79985a commit 70516a3
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions pkg/common/utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ func TestGetApplicationIDFromPod(t *testing.T) {

func TestCheckAppIdInPod(t *testing.T) {
mismatchError := errors.New("pod has inconsistent application ID")
tests := []struct {
testCases := []struct {
name string
pod *v1.Pod
expected error
Expand Down Expand Up @@ -774,11 +774,11 @@ func TestCheckAppIdInPod(t *testing.T) {
expected: mismatchError,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
err := CheckAppIdInPod(tt.pod)
if tt.expected != nil {
assert.ErrorContains(t, err, tt.expected.Error())
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
err := CheckAppIdInPod(tc.pod)
if tc.expected != nil {
assert.ErrorContains(t, err, tc.expected.Error())
} else {
assert.NilError(t, err)
}
Expand All @@ -788,7 +788,7 @@ func TestCheckAppIdInPod(t *testing.T) {

func TestCheckQueueNameInPod(t *testing.T) {
mismatchError := errors.New("pod has inconsistent queue name")
tests := []struct {
testCases := []struct {
name string
pod *v1.Pod
expected error
Expand Down Expand Up @@ -835,11 +835,11 @@ func TestCheckQueueNameInPod(t *testing.T) {
expected: mismatchError,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
err := CheckQueueNameInPod(tt.pod)
if tt.expected != nil {
assert.ErrorContains(t, err, tt.expected.Error())
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
err := CheckQueueNameInPod(tc.pod)
if tc.expected != nil {
assert.ErrorContains(t, err, tc.expected.Error())
} else {
assert.NilError(t, err)
}
Expand Down

0 comments on commit 70516a3

Please sign in to comment.