Merge pull request #8598 from mmorel-35/partially-fix-dupword

fix: dupword on tests
pull/8607/head
Tiger Kaovilai 2025-01-13 13:37:28 +07:00 committed by GitHub
commit fb7cf9e4ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 27 additions and 22 deletions

View File

@ -338,7 +338,6 @@ issues:
text: "DefaultVolumesToRestic" # No need to report deprecate for DefaultVolumesToRestic.
- path: ".*_test.go$"
linters:
- dupword
- errcheck
- goconst
- gosec
@ -349,7 +348,6 @@ issues:
- unused
- path: test/
linters:
- dupword
- errcheck
- goconst
- gosec
@ -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:

View File

@ -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

View File

@ -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(...)
@ -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 {

View File

@ -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,

View File

@ -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++