Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete the existing backuprepositories prior to a new test #1521

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

weshayutin
Copy link
Contributor

Why the changes were made

delete the backuprepository for cirros-test namespace if found.
The e2e tests use a new bsl for every test run but the backuprepository can be stale and prevent backups from passing.
We need to delete backuprepository as well.

How to test the changes made

make test-e2e with virt settings

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 13, 2024
@mateusoliveira43
Copy link
Contributor

Is this a VIRT only problem?

@weshayutin
Copy link
Contributor Author

Is this a VIRT only problem?

It's exposed with Virt simply because we have so many tests using the same namespace. It should also be a problem with DM tests that use the namespace. There is nothing bad about removing the backuprepo object in between tests.

@weshayutin
Copy link
Contributor Author

/retest

1 similar comment
@kaovilai
Copy link
Member

/retest

mateusoliveira43

This comment was marked as resolved.

@kaovilai
Copy link
Member

would simplify to just delete every backupRepository in OADP namespace

wouldn't this be too much cleanup and not representative of a real world usage?

@weshayutin
Copy link
Contributor Author

would simplify to just delete every backupRepository in OADP namespace

wouldn't this be too much cleanup and not representative of a real world usage?

We can and should have multiple b/r on the same namespace and we can write those tests. None of the current tests are designed for that atm imho. Each test is meant to be an initial backup. I am rewriting this to kill all the backuprepository's found.

@kaovilai
Copy link
Member

We actually run multiple backups on the same BSL and so currently backup repositories is reused. I am ok with this change, we can explicitly test in future tests

@weshayutin
Copy link
Contributor Author

/retest

@weshayutin weshayutin changed the title delete the backuprepository for cirros-test namespace if found delete the existing backuprepositories prior to a new test Sep 24, 2024
@weshayutin
Copy link
Contributor Author

@mateusoliveira43 look ok to you now? Thanks for the reviews and suggestions!


backupRepos, err := GetBackupRepositoryList(c, namespace)
if err != nil {
return fmt.Errorf("failed to get BackupRepository list: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would check if error was not found error, and it is, return nil (there are no BackupRepositories in this namespace, nothing to delete), also keeping generic error handling as it is now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, fixing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thanks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will break tests, first run will always fail, because there is no prior backupRepo, and and error will be returned

need to check if the error is not found error here for cases where there is no prior backupRepo,no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the same worry as you are expressing.

on line 150 I have
backupRepositoryList := &velero.BackupRepositoryList{
Items: []velero.BackupRepository{},

which should initialize the list w/ 0 items.
Unless I'm misunderstanding something, GetBackupRepositoryList should at minimum return an empty list or a populated list.

mateusoliveira43

This comment was marked as outdated.

Signed-off-by: Wesley Hayutin <[email protected]>
Copy link

openshift-ci bot commented Oct 1, 2024

@weshayutin: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Copy link
Member

@shubham-pampattiwar shubham-pampattiwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 1, 2024
Copy link

openshift-ci bot commented Oct 1, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: shubham-pampattiwar, weshayutin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants