-
Couldn't load subscription status.
- Fork 2.8k
Auhorization: Cherrypicked integration tests from V15 #20492
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
Auhorization: Cherrypicked integration tests from V15 #20492
Conversation
* Added authorization integration tests * Removed unnecessary tests and update tests for preview controller * Updated to use the newest changes from v15/dev and added an override for the AuthenticateClientAsync to use the userGroupKey * Updated CompatibilitySuppressions to include changes from integration tests * Updated pipelines * Skips managementApi tests * Only run necessary tests * Added new schema per fixture to reduce test setup time * Fixed failing tests * Updated test setup * Updated test * Added suppression * Fixed failing tests * Updated addOnTeardown methods to protected * Added method for clearing the host * Added teardown * Updated model usage * Added a lot of cleanup for memory leak issues when running tests * Added CompatibilitySuppressions.xml * Updated tests * Cleaned up * Adjusted base classes * Updated pipeline * Updated CompatibilitySuppressions.xml * Updated test logging * Fixed reponse * Updated condition to skip tests * Updated tests, not done * Reworked test to expect correct responses with correct setup * Updated tests * More updates to tests * Updated tests * Cleaned up tests * Updated setup * Cleaned up tests to match setup * Cleaned up setup * Removed suppression * Fixed tests * Move order of checks * Fix naming * Formatting * Dispose of host * Keep track of if we're disposed * Compat suppression * Dont dispose * Fix failing tests * removed unused virtual * Updated CompatibilitySuppressions.xml --------- Co-authored-by: Andreas Zerbst <[email protected]> Co-authored-by: Zeegaan <[email protected]> Co-authored-by: Nikolaj Geisle <[email protected]> # Conflicts: # tests/Umbraco.Tests.Integration/CompatibilitySuppressions.xml # tests/Umbraco.Tests.Integration/ManagementApi/ManagementApiTest.cs # tests/Umbraco.Tests.Integration/ManagementApi/Policies/AllCultureControllerTests.cs # tests/Umbraco.Tests.Integration/ManagementApi/Policies/CreateDocumentTests.cs # tests/Umbraco.Tests.Integration/ManagementApi/Policies/UpdateDocumentTests.cs # tests/Umbraco.Tests.Integration/ManagementApi/Preview/EndPreviewTests.cs # tests/Umbraco.Tests.Integration/ManagementApi/Preview/EnterPreviewTests.cs # tests/Umbraco.Tests.Integration/TestServerTest/UmbracoTestServerTestBase.cs
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.
Pull Request Overview
This PR cherry-picks authorization integration tests from version 15 of Umbraco CMS, focusing on Management API authorization patterns. The changes establish a comprehensive testing framework for user group authorization across all Management API controllers.
- Refactors base test infrastructure to support user group permission testing
- Adds authorization tests for nearly 50 Management API controllers
- Updates database setup patterns and factory management for test isolation
Reviewed Changes
Copilot reviewed 244 out of 244 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| UmbracoIntegrationTestBase.cs | Refactors database setup methods and changes field naming conventions |
| UmbracoWebApplicationFactory.cs | Adds host management capabilities for test cleanup |
| UmbracoTestServerTestBase.cs | Implements factory caching strategy and improves test lifecycle management |
| UserGroupAssertionModel.cs | New model for defining expected HTTP status codes per user group |
| Management API Controllers (50+ files) | Authorization test classes for all major Management API endpoints |
This PR cherry picks all our auhorization integration tests from v15, with some tweaks to both the tests and the pipeline