Change assertion order in tests.
parent
049292bd67
commit
b2768bdb56
|
@ -144,9 +144,9 @@ func TestLatestTagWarning(t *testing.T) {
|
|||
for _, scenario := range scenarios {
|
||||
t.Run(scenario.name, func(t *testing.T) {
|
||||
w, e, err := latestTagCheck.Run(scenario.arg)
|
||||
assert.NoError(t, err)
|
||||
assert.ElementsMatch(t, scenario.expected, w)
|
||||
assert.Empty(t, e)
|
||||
assert.Nil(t, err)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,9 +40,9 @@ func TestNamespaceWarning(t *testing.T) {
|
|||
for _, scenario := range scenarios {
|
||||
t.Run(scenario.name, func(t *testing.T) {
|
||||
w, e, err := namespace.Run(scenario.arg)
|
||||
assert.NoError(t, err)
|
||||
assert.ElementsMatch(t, scenario.expected, w)
|
||||
assert.Empty(t, e)
|
||||
assert.Nil(t, err)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,8 +47,10 @@ func TestNodeNameError(t *testing.T) {
|
|||
|
||||
for _, scenario := range scenarios {
|
||||
t.Run(scenario.name, func(t *testing.T) {
|
||||
_, e, _ := podSelectorCheck.Run(scenario.arg)
|
||||
w, e, err := podSelectorCheck.Run(scenario.arg)
|
||||
assert.NoError(t, err)
|
||||
assert.ElementsMatch(t, scenario.expected, e)
|
||||
assert.Empty(t, w)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,9 +83,9 @@ func TestPrivilegedContainerWarning(t *testing.T) {
|
|||
for _, scenario := range scenarios {
|
||||
t.Run(scenario.name, func(t *testing.T) {
|
||||
w, e, err := privilegedContainerCheck.Run(scenario.arg)
|
||||
assert.NoError(t, err)
|
||||
assert.ElementsMatch(t, scenario.expected, w)
|
||||
assert.Empty(t, e)
|
||||
assert.Nil(t, err)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue