Skip to content

test: integrate precreated CVI into precheck system#2331

Open
hardcoretime wants to merge 2 commits intomainfrom
chore/test/precreated-cvi-precheck
Open

test: integrate precreated CVI into precheck system#2331
hardcoretime wants to merge 2 commits intomainfrom
chore/test/precreated-cvi-precheck

Conversation

@hardcoretime
Copy link
Copy Markdown
Contributor

@hardcoretime hardcoretime commented May 7, 2026

Description

This PR integrates precreated ClusterVirtualImages (CVIs) into the precheck system for e2e tests.

Changes:

  1. New precheck implementation (internal/precheck/precreatedcvi.go):

    • Added PrecheckPrecreatedCVI as a common precheck that creates/verifies precreated CVIs before tests
    • Validates PRECREATED_CVI_CLEANUP env variable
    • Implements CleanupPrecreatedCVIs() function for cleanup in SynchronizedAfterSuite
  2. Config integration:

    • Added IsPrecreatedCVICleanupNeeded field to Config struct
    • Added support for PRECREATED_CVI_CLEANUP env variable with config priority over yaml
    • Added proper comments explaining the difference between post cleanup and precreated CVI cleanup
  3. Code organization:

    • Moved image URL constants from const.go to precreated_cvi.go for better cohesion
    • Removed legacy cleanup functions from config/cleanup.go and legacy/legacy.go
    • Removed unused suite_cvi.go and internal/precreatedcvi package

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

This refactoring consolidates all precreated CVI handling into the precheck system, making it consistent with other prechecks like PostCleanupPrecheck.

What is the expected result?

  • Precreated CVIs are automatically created/verified before tests run (via common precheck)
  • Cleanup behavior controlled via PRECREATED_CVI_CLEANUP env var or isPrecreatedCVICleanupNeeded config field
  • By default, CVIs persist between runs for faster test execution
  • Set PRECREATED_CVI_CLEANUP=yes to delete CVIs after the suite

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: test
type: chore
summary: "Integrate precreated CVI lifecycle into precheck system for e2e tests."
impact_level: low

@hardcoretime hardcoretime requested a review from Isteb4k as a code owner May 7, 2026 12:44
@hardcoretime hardcoretime changed the title refactor(test): integrate precreated CVI into precheck system test: integrate precreated CVI into precheck system May 7, 2026
@universal-itengineer universal-itengineer self-requested a review May 7, 2026 14:48
@universal-itengineer universal-itengineer added this to the v1.9.0 milestone May 7, 2026
Base automatically changed from chore/test/fix-postcleanup-precheck to main May 7, 2026 15:55
@hardcoretime hardcoretime dismissed universal-itengineer’s stale review May 7, 2026 15:55

The base branch was changed.

- Add PrecheckPrecreatedCVI as common precheck that creates/verifies CVIs
- Move image URL constants to precreated_cvi.go for better cohesion
- Add IsPrecreatedCVICleanupNeeded field to Config with proper comments
- Add precreatedCVI cleanup to SynchronizedAfterSuite (process 1 only)
- Remove legacy cleanup functions from config/cleanup.go and legacy.go
- Remove unused suite_cvi.go and internal/precreatedcvi package

BREAKING CHANGE: PRECREATED_CVI_CLEANUP env var now works with config system

Signed-off-by: Roman Sysoev <roman.sysoev@flant.com>
@hardcoretime hardcoretime force-pushed the chore/test/precreated-cvi-precheck branch from e32364a to ccbc526 Compare May 7, 2026 16:46
…rnings

- Pass context to waitForCVIsReady in precreatedcvi precheck
- Propagate context through util functions used by tests

Signed-off-by: Roman Sysoev <roman.sysoev@flant.com>
@hardcoretime hardcoretime force-pushed the chore/test/precreated-cvi-precheck branch from ccbc526 to 384b556 Compare May 7, 2026 16:56
@hardcoretime hardcoretime added the e2e/run Run e2e test on cluster of PR author label May 7, 2026
@deckhouse-BOaTswain
Copy link
Copy Markdown
Contributor

deckhouse-BOaTswain commented May 7, 2026

Workflow has started.
Follow the progress here: Workflow Run

The target step completed with status: failure.

@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label May 7, 2026
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.

3 participants