Skip to content

Conversation

@andr317c
Copy link
Contributor

This PR cherry picks all our auhorization integration tests from v15, with some tweaks to both the tests and the pipeline

nhudinh0309 and others added 4 commits October 14, 2025 10:08
* 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
@andr317c andr317c marked this pull request as ready for review October 14, 2025 09:30
Copilot AI review requested due to automatic review settings October 14, 2025 09:30
@andr317c andr317c enabled auto-merge (squash) October 14, 2025 09:32
Copy link
Contributor

Copilot AI left a 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

@andr317c andr317c merged commit 7f1cdf8 into release/17.0 Oct 14, 2025
20 of 21 checks passed
@andr317c andr317c deleted the v17/QA/cherry-pick-auth-integration-tests branch October 14, 2025 10:04
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.

4 participants