diff --git a/.golangci.yaml b/.golangci.yaml index 8bd3caa9e6..7c56dbcec0 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -239,7 +239,6 @@ linters-settings: # TODO: enable them all disable: - bool-compare - - compares - error-is-as - error-nil - expected-actual @@ -249,10 +248,7 @@ linters-settings: - suite-dont-use-pkg - suite-extra-assert-call - suite-thelper - enable: - - empty - - len - - nil-compare + enable-all: true testpackage: # regexp pattern to skip files skip-regexp: (export|internal)_test\.go diff --git a/pkg/backup/backup_test.go b/pkg/backup/backup_test.go index 86aa2ee43b..e787827a9f 100644 --- a/pkg/backup/backup_test.go +++ b/pkg/backup/backup_test.go @@ -3496,7 +3496,7 @@ func assertTarballOrdering(t *testing.T, backupFile io.Reader, orderedResources // get the resource name parts := strings.Split(hdr.Name, "/") - require.True(t, len(parts) >= 2) + require.GreaterOrEqual(t, len(parts), 2) resourceName := parts[1] // Find the index in 'orderedResources' of the resource type for @@ -3516,7 +3516,7 @@ func assertTarballOrdering(t *testing.T, backupFile io.Reader, orderedResources // the index of the current resource must be the same as or greater than the index of // the last resource we saw for the backed-up order to be correct. - assert.True(t, current >= lastSeen, "%s was backed up out of order", resourceName) + assert.GreaterOrEqual(t, current, lastSeen, "%s was backed up out of order", resourceName) lastSeen = current } } diff --git a/pkg/controller/backup_controller_test.go b/pkg/controller/backup_controller_test.go index c89bdf3894..2f613af2cb 100644 --- a/pkg/controller/backup_controller_test.go +++ b/pkg/controller/backup_controller_test.go @@ -571,11 +571,11 @@ func TestDefaultVolumesToResticDeprecation(t *testing.T) { if test.expectRemap { assert.Equal(t, res.Spec.DefaultVolumesToRestic, res.Spec.DefaultVolumesToFsBackup) } else if test.expectGlobal { - assert.False(t, res.Spec.DefaultVolumesToRestic == res.Spec.DefaultVolumesToFsBackup) + assert.NotSame(t, res.Spec.DefaultVolumesToRestic, res.Spec.DefaultVolumesToFsBackup) assert.Equal(t, &c.defaultVolumesToFsBackup, res.Spec.DefaultVolumesToFsBackup) } else { - assert.False(t, res.Spec.DefaultVolumesToRestic == res.Spec.DefaultVolumesToFsBackup) - assert.False(t, &c.defaultVolumesToFsBackup == res.Spec.DefaultVolumesToFsBackup) + assert.NotSame(t, res.Spec.DefaultVolumesToRestic, res.Spec.DefaultVolumesToFsBackup) + assert.NotEqual(t, &c.defaultVolumesToFsBackup, res.Spec.DefaultVolumesToFsBackup) } assert.Equal(t, test.expectVal, *res.Spec.DefaultVolumesToFsBackup) diff --git a/pkg/restore/restore_test.go b/pkg/restore/restore_test.go index 19f66e9bd1..8b483059a8 100644 --- a/pkg/restore/restore_test.go +++ b/pkg/restore/restore_test.go @@ -3598,7 +3598,7 @@ func assertResourceCreationOrder(t *testing.T, resourcePriorities []string, crea // the index of the current resource must be the same as or greater than the index of // the last resource we saw for the restored order to be correct. - assert.True(t, current >= lastSeen, "%s was restored out of order", r.groupResource) + assert.GreaterOrEqual(t, current, lastSeen, "%s was restored out of order", r.groupResource) lastSeen = current } }