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

Simplify test and improve test logging #76

Merged
merged 1 commit into from
Sep 5, 2022

Conversation

brybacki
Copy link
Contributor

Signed-off-by: Bartosz Rybacki brybacki@redhat.com

What this PR does / why we need it:
Test failed:
https://prow.ci.kubevirt.io/view/gs/kubevirt-prow/pr-logs/pull/kubevirt_kubevirt-velero-plugin/75/pull-kvp-functional-test/1562787451645202432

This PR improves logging for troubleshooting.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:

NONE

@kubevirt-bot kubevirt-bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Aug 26, 2022
@brybacki
Copy link
Contributor Author

/test pull-kvp-functional-test

err = StartVirtualMachine(*kvClient, namespace.Name, vm.Name)
Expect(err).ToNot(HaveOccurred())

err = WaitForDataVolumePhase(*kvClient, namespace.Name, cdiv1.Succeeded, vmSpec.Spec.DataVolumeTemplates[0].Name)
Copy link
Member

Choose a reason for hiding this comment

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

With GC can you be sure the DV is still around? Maybe wait for the VM to have started, the DV will be guaranteed to be completed at that point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well, that means I need to verify the whole test suite! and that is a bigger task. Maybe I can even move the verification to StartVirtualMachine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but this is a task for another PR.
BTW: is GC enabled by default in all tests?

Copy link
Member

Choose a reason for hiding this comment

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

I currently don't think the default is GC, but likely it will be soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#78

@@ -45,138 +65,121 @@ var _ = Describe("[smoke] VM Backup", func() {
r.Dump(CurrentGinkgoTestDescription().Duration)
}

// Deleting the backup also deletes all restores, volume snapshots etc.
err := DeleteBackup(timeout, backupName, r.BackupNamespace)
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe better expressed as Expect(err).ToNot(HaveOccurred()) that will print the error message if an error occurred.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Then, wen it fails it does not try to remove VM. After one or two such failures other tests may fail due too not enough resources.

Maybe I can change it to new gingko Defer(), but this is also a task for another PR.

Copy link
Member

Choose a reason for hiding this comment

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

Gotcha, yeah if you are worried about the cleanup make sure you either clean it up in an AfterEach or use a defer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is AfterEach(), and I think failing an Expect() would not run next cleanups.

tests/vm_backup_test.go Show resolved Hide resolved
tests/utils.go Outdated Show resolved Hide resolved
tests/utils.go Outdated Show resolved Hide resolved
tests/vm_backup_test.go Outdated Show resolved Hide resolved
tests/vm_backup_test.go Outdated Show resolved Hide resolved
tests/vm_backup_test.go Outdated Show resolved Hide resolved
tests/vm_backup_test.go Outdated Show resolved Hide resolved
Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>
@maya-r
Copy link
Contributor

maya-r commented Sep 5, 2022

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Sep 5, 2022
@brybacki
Copy link
Contributor Author

brybacki commented Sep 5, 2022

/approve

@kubevirt-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brybacki

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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 5, 2022
@kubevirt-bot kubevirt-bot merged commit cdbd150 into kubevirt:main Sep 5, 2022
@brybacki brybacki deleted the vm-bkup-test-log branch October 5, 2022 11:04
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants