Skip to content

test: migrate vdsnapshots e2e to new framefork#2350

Open
eofff wants to merge 5 commits into
mainfrom
test/vd-snapshot-e2e-new-framework
Open

test: migrate vdsnapshots e2e to new framefork#2350
eofff wants to merge 5 commits into
mainfrom
test/vd-snapshot-e2e-new-framework

Conversation

@eofff
Copy link
Copy Markdown
Contributor

@eofff eofff commented May 14, 2026

Description

Migrate vdsnapshots e2e to new framefork.

Why do we need it, and what problem does it solve?

What is the expected result?

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: vd
type: chore
summary: Migrate vdsnapshots e2e to new framefork.

@eofff eofff changed the title test: vd_snapshots new framefork test: migrate vdsnapshots e2e to new framefork May 15, 2026
@eofff eofff requested a review from hardcoretime May 15, 2026 08:20
@eofff eofff added this to the v1.9.0 milestone May 15, 2026
@eofff eofff marked this pull request as ready for review May 15, 2026 08:21
@eofff eofff requested a review from Isteb4k as a code owner May 15, 2026 08:21
Comment thread test/e2e/internal/util/vd.go Outdated
Comment thread test/e2e/internal/util/vm.go Outdated
Comment thread test/e2e/vd/vd_snapshots.go Outdated
Comment thread test/e2e/vd/vd_snapshots.go Outdated
Comment on lines +277 to +289
volumeSnapshot := &unstructured.Unstructured{}
volumeSnapshot.SetAPIVersion("snapshot.storage.k8s.io/v1")
volumeSnapshot.SetKind("VolumeSnapshot")
err = f.GenericClient().Get(ctx, crclient.ObjectKey{
Namespace: actualVDSnapshot.Namespace,
Name: actualVDSnapshot.Status.VolumeSnapshotName,
}, volumeSnapshot)
Expect(err).NotTo(HaveOccurred())

readyToUse, found, err := unstructured.NestedBool(volumeSnapshot.Object, "status", "readyToUse")
Expect(err).NotTo(HaveOccurred())
Expect(found).To(BeTrue(), "VolumeSnapshot status.readyToUse must be present")
Expect(readyToUse).To(BeTrue(), "VolumeSnapshot status.readyToUse must be true")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this required in the test?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Exactly

Comment thread test/e2e/vd/vd_snapshots.go Outdated
Comment thread test/e2e/vd/vd_snapshots.go Outdated
Comment thread test/e2e/vd/vd_snapshots.go Outdated
vmWatchErrCh := make(chan error, 1)
var vmWasFrozen atomic.Bool
go func() {
wasFrozen, err := ensureVMWasFrozenInProgress(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It seems that Eventually is sufficient for this test case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Need to watch without blocking


const vdSnapshotNSPrefix = "virtual-disk-snapshots"

var _ = Describe("VirtualDiskSnapshots", Label(precheck.PrecheckImmediateStorageClass, precheck.PrecheckSnapshot), func() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Without ordering, all It containers will run simultaneously when Ginkgo runs in parallel. If you want to run it in parallel, split it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What's the problem now?

"github.com/deckhouse/virtualization/test/e2e/internal/util"
)

const vdSnapshotNSPrefix = "virtual-disk-snapshots"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Move it under Describe or delete it if the test cases will be split.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What's the problem with this const?

Valeriy Khorunzhin added 4 commits May 20, 2026 16:47
Signed-off-by: Valeriy Khorunzhin <valeriy.khorunzhin@flant.com>
Signed-off-by: Valeriy Khorunzhin <valeriy.khorunzhin@flant.com>
Signed-off-by: Valeriy Khorunzhin <valeriy.khorunzhin@flant.com>
Signed-off-by: Valeriy Khorunzhin <valeriy.khorunzhin@flant.com>
@eofff eofff force-pushed the test/vd-snapshot-e2e-new-framework branch from 0cc79e6 to 76fdd51 Compare May 20, 2026 13:47
Signed-off-by: Valeriy Khorunzhin <valeriy.khorunzhin@flant.com>
@eofff eofff requested a review from hardcoretime May 20, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants