Skip to content

test: add postcleanup mode#2417

Open
yaroslavborbat wants to merge 1 commit into
mainfrom
test/add-postcleanup-mode
Open

test: add postcleanup mode#2417
yaroslavborbat wants to merge 1 commit into
mainfrom
test/add-postcleanup-mode

Conversation

@yaroslavborbat
Copy link
Copy Markdown
Member

@yaroslavborbat yaroslavborbat commented May 29, 2026

Description

Replace boolean IsCleanupNeeded flag with PostCleanupMode enum in e2e test config.

New values for POST_CLEANUP env:

  • always (default) — always clean up resources after tests
  • never — never clean up (useful for debugging)
  • no-failure — skip cleanup only when the test suite fails, preserving resources on failure for investigation (cleanup runs on success)

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

The old boolean flag (yes/no) didn't allow keeping resources when tests fail while still cleaning up on success. The new no-failure mode fills this gap, making it easier to debug failing e2e tests without manually toggling cleanup.

What is the expected result?

  1. Set POST_CLEANUP=no-failure before running e2e tests
  2. If tests pass — resources are cleaned up as usual
  3. If tests fail — resources remain in the cluster for investigation

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: Replace boolean POST_CLEANUP flag with PostCleanupMode enum (always/never/no-failure) in e2e config.
impact_level: low

Signed-off-by: Yaroslav Borbat <[email protected]>
@yaroslavborbat yaroslavborbat force-pushed the test/add-postcleanup-mode branch from f09d14b to 65ccfa1 Compare May 29, 2026 14:26

// PostCleanupEnv defines an environment variable used to explicitly request the deletion of created/used resources.
// Valid values: "yes", "no", or "" (default = yes).
// Valid values: "always", "never", "no-failure", or "" (default = always).
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.

Suggested change
// Valid values: "always", "never", "no-failure", or "" (default = always).
// Valid values: "always", "never", "no-on-failure", or "" (default = always).

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