Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor e2e cleanup behavior for SKIP_RESOURCE_CLEANUP and SkipDeletionTest #1161

Merged
merged 3 commits into from
Mar 21, 2025

Conversation

valaparthvi
Copy link
Contributor

@valaparthvi valaparthvi commented Mar 19, 2025

kind/refactor

What this PR does / why we need it:

This PR adds a minor refactor to e2e cleanup. Currently, if SkipDeletionTest is true, the cluster resources get deleted anyway since the git repo is deleted. There seem to be discrepancy in the way resources are cleaned up.
This PR mainly attempts to reinforce the following behavior:

  1. If input.SkipCleanup is true, then rancher-turtles and gitea charts must be retained, along with the management cluster.
  2. If input.SkipDeletionTest is true, the capicluster resources must be retained, along with the git repo, rancher-turtles, and gitea charts. This retention is required so that cluster can be worked with even after the test finishes.
  3. If input.SkipDeletionTest is false and input.SkipCleanup is true, the capicluster and git repo must be deleted, rancher-turtles and gitea charts must be retained along with the management cluster.
  4. If input.SkipDeletionTest is false and input.SkipCleanup is false, everything must be deleted.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:
It is best to run the changes locally with the following options:

input.SkipDeletionTest input.SkipCleanup RT&Gitea Charts Git repo & cluster Management Cluster
true true no delete no delete no delete
true false delete delete delete
false true no delete delete no delete
false false delete delete delete

Once these changes are accepted, I will make similar changes to backuprestore and other test suites.
Checklist:

  • squashed commits into logical changes
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

Sorry, something went wrong.

@valaparthvi valaparthvi added the area/testing Indicates an issue related to test label Mar 19, 2025
@valaparthvi valaparthvi requested a review from a team as a code owner March 19, 2025 11:04
@valaparthvi valaparthvi changed the title Refactor e2e cleanup WIP: Refactor e2e cleanup Mar 19, 2025
salasberryfin
salasberryfin previously approved these changes Mar 20, 2025
@valaparthvi valaparthvi changed the title WIP: Refactor e2e cleanup WIP: Refactor e2e cleanup behavior for SKIP_RESOURCE_CLEANUP and SkipDeletionTest Mar 20, 2025
@Danil-Grigorev
Copy link
Contributor

@valaparthvi Can you please add the table from the “Special notes for your reviewer” section into e2e/README.md for cleanup configuration? It would help in deciding which to use.

Signed-off-by: Parthvi Vala <parthvi.vala@suse.com>
Signed-off-by: Parthvi Vala <parthvi.vala@suse.com>
@valaparthvi valaparthvi changed the title WIP: Refactor e2e cleanup behavior for SKIP_RESOURCE_CLEANUP and SkipDeletionTest Refactor e2e cleanup behavior for SKIP_RESOURCE_CLEANUP and SkipDeletionTest Mar 20, 2025
…Dump to before charts uninstallation and management cluster deletion

Signed-off-by: Parthvi Vala <parthvi.vala@suse.com>
@alexander-demicev alexander-demicev merged commit de11d0a into rancher:main Mar 21, 2025
8 checks passed
yiannistri pushed a commit to yiannistri/turtles that referenced this pull request Mar 21, 2025
…ionTest (rancher#1161)

* Refactor e2e cleanup

Signed-off-by: Parthvi Vala <parthvi.vala@suse.com>

* Revert focus on test

Signed-off-by: Parthvi Vala <parthvi.vala@suse.com>

* Add data to e2e/readme, refactor the behavior, move BootstrapArtifactDump to before charts uninstallation and management cluster deletion

Signed-off-by: Parthvi Vala <parthvi.vala@suse.com>

---------

Signed-off-by: Parthvi Vala <parthvi.vala@suse.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing Indicates an issue related to test
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants