Skip to content

Commit

Permalink
Merge pull request #8598 from mmorel-35/partially-fix-dupword
Browse files Browse the repository at this point in the history
fix: dupword on tests
  • Loading branch information
kaovilai authored Jan 13, 2025
2 parents 3207619 + 80bba2e commit fb7cf9e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 22 deletions.
10 changes: 8 additions & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ issues:
text: "DefaultVolumesToRestic" # No need to report deprecate for DefaultVolumesToRestic.
- path: ".*_test.go$"
linters:
- dupword
- errcheck
- goconst
- gosec
Expand All @@ -349,7 +348,6 @@ issues:
- unused
- path: test/
linters:
- dupword
- errcheck
- goconst
- gosec
Expand All @@ -358,6 +356,14 @@ issues:
- stylecheck
- unparam
- unused
- path: ".*data_upload_controller_test.go$"
linters:
- dupword
text: "type"
- path: ".*config_test.go$"
linters:
- dupword
text: "bucket"

# The list of ids of default excludes to include or disable. By default it's empty.
include:
Expand Down
2 changes: 1 addition & 1 deletion internal/delete/delete_item_action_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func (h *harness) addResource(t *testing.T, resource *test.APIResource) {
}

// recordResourcesAction is a delete item action that can be configured to run
// for specific resources/namespaces and simply record the items that is is
// for specific resources/namespaces and simply record the items that is
// executed for.
type recordResourcesAction struct {
selector velero.ResourceSelector
Expand Down
4 changes: 2 additions & 2 deletions pkg/restore/restore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1709,7 +1709,7 @@ func (a *pluggableAction) AreAdditionalItemsReady(additionalItems []velero.Resou
}

// TestRestoreActionModifications runs restores with restore item actions that modify resources, and
// verifies that that the modified item is correctly created in the API. Verification is done by looking
// verifies that the modified item is correctly created in the API. Verification is done by looking
// at the full object in the API.
func TestRestoreActionModifications(t *testing.T) {
// modifyingActionGetter is a helper function that returns a *pluggableAction, whose Execute(...)
Expand Down Expand Up @@ -2006,7 +2006,7 @@ func TestRestoreWithAsyncOperations(t *testing.T) {
}

// TestRestoreActionAdditionalItems runs restores with restore item actions that return additional items
// to be restored, and verifies that that the correct set of items is created in the API. Verification is
// to be restored, and verifies that the correct set of items is created in the API. Verification is
// done by looking at the namespaces/names of the items in the API; contents are not checked.
func TestRestoreActionAdditionalItems(t *testing.T) {
tests := []struct {
Expand Down
8 changes: 4 additions & 4 deletions pkg/util/csi/volume_snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1684,28 +1684,28 @@ func TestWaitUntilVSCHandleIsReady(t *testing.T) {
},
},
{
name: "waitDisabled should not find volumesnapshotcontent volumesnapshot status is nil",
name: "waitDisabled should not find volumesnapshotcontent when volumesnapshot status is nil",
wait: false,
expectError: false,
exepctedVSC: nil,
volSnap: vsWithNilStatus,
},
{
name: "waitDisabled should not find volumesnapshotcontent volumesnapshot status.BoundVolumeSnapshotContentName is nil",
name: "waitDisabled should not find volumesnapshotcontent when volumesnapshot status.BoundVolumeSnapshotContentName is nil",
wait: false,
expectError: false,
exepctedVSC: nil,
volSnap: vsWithNilStatusField,
},
{
name: "waitDisabled should find volumesnapshotcontent volumesnapshotcontent status is nil",
name: "waitDisabled should find volumesnapshotcontent when volumesnapshotcontent status is nil",
wait: false,
expectError: false,
exepctedVSC: vscWithNilStatus,
volSnap: vsForNilStatusVsc,
},
{
name: "waitDisabled should find volumesnapshotcontent volumesnapshotcontent status.SnapshotHandle is nil",
name: "waitDisabled should find volumesnapshotcontent when volumesnapshotcontent status.SnapshotHandle is nil",
wait: false,
expectError: false,
exepctedVSC: vscWithNilStatusField,
Expand Down
25 changes: 12 additions & 13 deletions test/util/velero/velero_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -786,19 +786,18 @@ func WaitForVSphereUploadCompletion(ctx context.Context, timeout time.Duration,
for _, curLine := range lines {
fmt.Printf("%s %s\n", curLine, time.Now().Format("2006-01-02 15:04:05"))
comps := strings.Split(curLine, "=")
// SnapshotPhase represents the lifecycle phase of a Snapshot.
// New - No work yet, next phase is InProgress
// InProgress - snapshot being taken
// Snapshotted - local snapshot complete, next phase is Protecting or SnapshotFailed
// SnapshotFailed - end state, snapshot was not able to be taken
// Uploading - snapshot is being moved to durable storage
// Uploaded - end state, snapshot has been protected
// UploadFailed - end state, unable to move to durable storage
// Canceling - when the SanpshotCancel flag is set, if the Snapshot has not already moved into a terminal state, the
// status will move to Canceling. The snapshot ID will be removed from the status status if has been filled in
// and the snapshot ID will not longer be valid for a Clone operation
// Canceled - the operation was canceled, the snapshot ID is not valid
// Canceled - the operation was canceled, the snapshot ID is not valid
// SnapshotPhase represents the lifecycle phase of a Snapshot:
// * New: No work yet, next phase is InProgress
// * InProgress: snapshot being taken
// * Snapshotted: local snapshot complete, next phase is Protecting or SnapshotFailed
// * SnapshotFailed: end state, snapshot was not able to be taken
// * Uploading: snapshot is being moved to durable storage
// * Uploaded: end state, snapshot has been protected
// * UploadFailed: end state, unable to move to durable storage
// * Canceling: when the SanpshotCancel flag is set, if the Snapshot has not already moved into a terminal state, the
// status will move to Canceling. The snapshot ID will be removed from the status if the status has been filled in
// and the snapshot ID will not longer be valid for a Clone operation
// * Canceled: the operation was canceled, the snapshot ID is not valid
if len(comps) == 2 {
phase := comps[1]
actualCount++
Expand Down

0 comments on commit fb7cf9e

Please sign in to comment.