-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mmyoungman
requested changes
Sep 16, 2024
src/GovUk.Education.ExploreEducationStatistics.Admin/Services/ThemeService.cs
Outdated
Show resolved
Hide resolved
src/GovUk.Education.ExploreEducationStatistics.Admin/Services/ThemeService.cs
Outdated
Show resolved
Hide resolved
src/GovUk.Education.ExploreEducationStatistics.Admin/Services/ThemeService.cs
Outdated
Show resolved
Hide resolved
src/GovUk.Education.ExploreEducationStatistics.Admin/Services/ThemeService.cs
Outdated
Show resolved
Hide resolved
src/GovUk.Education.ExploreEducationStatistics.Admin/Services/ThemeService.cs
Show resolved
Hide resolved
mmyoungman
reviewed
Sep 17, 2024
src/GovUk.Education.ExploreEducationStatistics.Admin/Services/ThemeService.cs
Show resolved
Hide resolved
src/GovUk.Education.ExploreEducationStatistics.Admin/Services/ThemeService.cs
Outdated
Show resolved
Hide resolved
src/GovUk.Education.ExploreEducationStatistics.Admin/Services/ThemeService.cs
Outdated
Show resolved
Hide resolved
f3337be
to
ef9dfb2
Compare
mmyoungman
requested changes
Sep 17, 2024
.OnSuccess(_ => _context.Themes | ||
.Where(theme => theme.Title.Contains("UI test")) | ||
.Include(theme => theme.Topics)) | ||
.OnSuccessVoid(async themes => |
There was a problem hiding this comment.
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
.
src/GovUk.Education.ExploreEducationStatistics.Admin.Tests/Services/ThemeServiceTests.cs
Show resolved
Hide resolved
src/GovUk.Education.ExploreEducationStatistics.Admin.Tests/Services/ThemeServiceTests.cs
Show resolved
Hide resolved
ef9dfb2
to
5430afa
Compare
mmyoungman
requested changes
Sep 17, 2024
...vUk.Education.ExploreEducationStatistics.Admin.Tests/Services/ThemeServicePermissionTests.cs
Show resolved
Hide resolved
src/GovUk.Education.ExploreEducationStatistics.Admin/Services/ThemeService.cs
Show resolved
Hide resolved
5430afa
to
8bb6bb3
Compare
mmyoungman
approved these changes
Sep 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.