mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-17 21:44:23 +00:00
testifylint: enable error-nil rule (#7670)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
@@ -129,7 +129,7 @@ func TestCreateOptions_BuildBackupFromSchedule(t *testing.T) {
|
||||
|
||||
func TestCreateOptions_OrderedResources(t *testing.T) {
|
||||
_, err := ParseOrderedResources("pods= ns1/p1; ns1/p2; persistentvolumeclaims=ns2/pvc1, ns2/pvc2")
|
||||
assert.NotNil(t, err)
|
||||
assert.Error(t, err)
|
||||
|
||||
orderedResources, err := ParseOrderedResources("pods= ns1/p1,ns1/p2 ; persistentvolumeclaims=ns2/pvc1,ns2/pvc2")
|
||||
assert.NoError(t, err)
|
||||
|
||||
@@ -148,7 +148,7 @@ func TestCreateCommand_Run(t *testing.T) {
|
||||
|
||||
o.Complete(args, f)
|
||||
e := o.Validate(c, args, f)
|
||||
assert.Nil(t, e)
|
||||
assert.NoError(t, e)
|
||||
|
||||
e = o.Run(c, f)
|
||||
assert.Contains(t, e.Error(), fmt.Sprintf("%s: no such file or directory", caCertFile))
|
||||
|
||||
@@ -66,7 +66,7 @@ func TestNewSetCommand(t *testing.T) {
|
||||
args := []string{backupName}
|
||||
o.Complete(args, f)
|
||||
e := o.Validate(c, args, f)
|
||||
assert.Nil(t, e)
|
||||
assert.NoError(t, e)
|
||||
|
||||
e = o.Run(c, f)
|
||||
assert.Contains(t, e.Error(), fmt.Sprintf("%s: no such file or directory", cacert))
|
||||
|
||||
@@ -28,7 +28,7 @@ import (
|
||||
func TestCompleteOfSelectOption(t *testing.T) {
|
||||
option := &SelectOptions{}
|
||||
args := []string{"arg1", "arg2"}
|
||||
require.Nil(t, option.Complete(args))
|
||||
require.NoError(t, option.Complete(args))
|
||||
assert.Equal(t, args, option.Names)
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@ func TestValidateOfSelectOption(t *testing.T) {
|
||||
Selector: flag.LabelSelector{},
|
||||
All: false,
|
||||
}
|
||||
assert.NotNil(t, option.Validate())
|
||||
assert.Error(t, option.Validate())
|
||||
|
||||
option.All = true
|
||||
assert.Nil(t, option.Validate())
|
||||
assert.NoError(t, option.Validate())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user