test(disks): extract DataExport to util.go and add phase watcher#2311
Draft
hardcoretime wants to merge 1 commit intomainfrom
Draft
test(disks): extract DataExport to util.go and add phase watcher#2311hardcoretime wants to merge 1 commit intomainfrom
hardcoretime wants to merge 1 commit intomainfrom
Conversation
89f840a to
a62125c
Compare
- Add EventPhaseWatcher for tracking resource phase transitions - Add VerifyPhaseTransitions helper for phase sequence verification - Extract DataExport, IsNFS, needPublishOption to util.go - Add VirtualDiskPhaseTransitions test for export flow Signed-off-by: Roman Sysoev <roman.sysoev@flant.com>
a62125c to
79c5b2f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds EventPhaseWatcher utility for tracking phase transitions in e2e tests and refactors DataExport functionality.
Changes:
test/e2e/internal/util/event_watcher.go: ImplementsEventPhaseWatcherthat uses Kubernetes Watch API to track phase changes in real-time instead of polling. Includes helper methods likeHasSequence,ContainsPhase, andVerifyPhaseTransitionsfor verifying phase transitions.test/e2e/blockdevice/util.go: Extracts common export utilities (DataExport,IsNFS,needPublishOption) fromdata_exports.gofor reuse.test/e2e/blockdevice/vd_phase_transitions.go: AddsVirtualDiskPhaseTransitionstest that verifies the expected phase sequence (Ready → Exporting → Ready) during VirtualDisk export using the new EventPhaseWatcher.test/e2e/blockdevice/data_exports.go: Removes duplicate export functions, now usesDataExportfrom util.go.Why do we need it, and what problem does it solve?
The main goal is to track resource phases during various operations (export, upload, resize, etc.) to detect problems in phase transitions.
EventPhaseWatcher provides a more reliable mechanism by using Kubernetes Watch API to observe phase changes in real-time. This allows tests to verify that resources go through the expected phase sequence and fail early if incorrect phases are observed (e.g., PVCLost, Failed, etc.).
What is the expected result?
Phase sequence verification (
Ready → Exporting → Ready) is performed automatically.Checklist
Changelog entries