Skip to content

test: add PostCleanup precheck#2320

Merged
hardcoretime merged 5 commits into
mainfrom
test/e2e/add-postcleanup-precheck
May 6, 2026
Merged

test: add PostCleanup precheck#2320
hardcoretime merged 5 commits into
mainfrom
test/e2e/add-postcleanup-precheck

Conversation

@hardcoretime

@hardcoretime hardcoretime commented May 5, 2026

Copy link
Copy Markdown
Contributor

Description

Add PostCleanup precheck to the e2e test framework and integrate it with the Config struct.

Changes include:

  • Add IsCleanupNeeded field to Config struct in test/e2e/internal/config/config.go
  • Add default value isCleanupNeeded: true in test/e2e/default_config.yaml
  • Create new postcleanup precheck in test/e2e/internal/precheck/postcleanup.go that validates the POST_CLEANUP environment variable
  • Add PrecheckPostCleanup label to test/e2e/internal/precheck/labels.go
  • Refactor legacy test files to use conf.IsCleanupNeeded instead of the old config.IsCleanUpNeeded() function
  • Refactor framework.go and suite_cvi.go to use GetConfig().IsCleanupNeeded
  • Update test/e2e/README.md to document the new configuration option

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

The e2e test framework previously used the config.IsCleanUpNeeded() function that directly read the POST_CLEANUP environment variable without considering the YAML configuration. This change:

  1. Moves cleanup configuration to the Config struct, making it consistent with other configuration options
  2. Adds a proper precheck that validates the POST_CLEANUP environment variable before running tests
  3. Provides better documentation for users about how to control cleanup behavior

What is the expected result?

  • Tests continue to work with the default cleanup behavior (enabled)
  • Users can disable cleanup via POST_CLEANUP=no environment variable (takes precedence over YAML)
  • Users can configure default cleanup behavior via isCleanupNeeded field in default_config.yaml
  • All legacy tests and framework use the same configuration source

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: "Add PostCleanup precheck and IsCleanupNeeded config option for e2e tests."
impact_level: low

Roman Sysoev added 5 commits May 5, 2026 18:06
Signed-off-by: Roman Sysoev <roman.sysoev@flant.com>
Signed-off-by: Roman Sysoev <roman.sysoev@flant.com>
Signed-off-by: Roman Sysoev <roman.sysoev@flant.com>
Signed-off-by: Roman Sysoev <roman.sysoev@flant.com>
Signed-off-by: Roman Sysoev <roman.sysoev@flant.com>
@hardcoretime hardcoretime requested a review from Isteb4k as a code owner May 5, 2026 15:24
@hardcoretime hardcoretime added this to the v1.9.0 milestone May 5, 2026
@hardcoretime hardcoretime requested a review from LopatinDmitr May 6, 2026 13:19
@hardcoretime hardcoretime merged commit 78f5a85 into main May 6, 2026
31 of 34 checks passed
@hardcoretime hardcoretime deleted the test/e2e/add-postcleanup-precheck branch May 6, 2026 13:23
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