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

EES-4489: Add endpoint to remove all themes created by UI tests #5246

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

tomjonesdev
Copy link
Collaborator

Robot UI tests generate themes and topics as part of their process, which are then removed during the teardown phase. This phase uses an existing endpoint which accepts an ID to target the removal of an individual resource.

UI test execution occasionally fails, or is cancelled prematurely, meaning that the teardown phase isn't triggered. This results in test resources remaining in the system and causing bloat.

This PR adds an endpoint which removes all themes and associated topics created during UI tests in one go, using the same logic to identify tests as is used for individual removal. The intended use for this endpoint is as part of a manual clean-up process when a notification is received regarding test execution failure, or eventually implemented into an automated process.

The PR also includes a few minor recommended code style amendments.

.OnSuccess(_ => _context.Themes
.Where(theme => theme.Title.Contains("UI test"))
.Include(theme => theme.Topics))
.OnSuccessVoid(async themes =>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to check _themeDeletionAllowed here to prevent people removing themes on prod - the same as in CheckCanDeleteThemes.

@tomjonesdev tomjonesdev merged commit a1b7acc into dev Sep 17, 2024
7 checks passed
@tomjonesdev tomjonesdev deleted the EES-4489 branch September 17, 2024 16:19
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