[MGNLMIGRATION-322] Improve comparison of users/userGroups/userRoles workspace Created: 24/Feb/14  Updated: 09/May/14  Resolved: 09/May/14

Status: Closed
Project: Migration 4.4 to 4.5 (closed)
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2.10

Type: Improvement Priority: Major
Reporter: Roman Kovařík Assignee: Robert Šiška
Resolution: Fixed Votes: 0
Labels: maintenance
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
is depended upon by MGNLSTK-1374 Updated instances behave as freshly i... Closed
Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

info.magnolia.module.migrationtests.CompareConfigsTest.testCompareUsersWorkspace() currently has a lot of ignores specified:

public void testCompareUsersWorkspace() throws Exception {
        assertTrue(compare("/", RepositoryConstants.USERS, new String[] {
                "/system/superuser/lastaccess",
                "/system/superuser/pswd",
                "/system/anonymous/pswd",
        }));
    }

Although ignoring of password and lastaccess properties is not so bad, bigger problem is with ids of roles which could be added in different order on fresh/updated instance:
http://hudson.magnolia-cms.com/job/int_migration-tests_4.4-to-4.5.x-branch/ws/magnolia-migration-integration/diff-reports/users.html

  • same applies to (userGroups - switched assigned roles and userRoles - switched permissions)

Implement comparison which handle such cases (parse out the report if no better idea). Please move such tests out of CompareConfigsTest to something like Compare*Workspace if it would require new implementation.



 Comments   
Comment by Milan Divilek [ 27/Mar/14 ]

Reopen:

Seems that "deepcompare" doesn't work at all and also ignoring path looks broken.

assertTrue(compare("/", "users", new String[] {
                "/system/superuser/lastaccess",
                "/system/superuser/pswd",
                "/system/anonymous/pswd",
                "/admin/peter/pswd",
                "/admin/eric/pswd",
        }, new String[] { // subdirectories of these paths might be shuffled, but values have to match.
                "/system/superuser/roles",
                "/system/anonymous/roles"
        }));

see http://hudson.magnolia-cms.com/view/MaintenanceX/job/int_migration-tests_4.4-to-4.5.x-branch/ws/magnolia-migration-integration/diff-reports/users.html

For example all password properties should be ignored, but they are not.

On "/system/anonymous/roles" "deepcompare" should be used, but roles are still marked as different because of different order.

"Deepcompare" needs to be used also is usergroups and user roles workspaces.

For example

"/demo-project-editors/groups",
"/demo-project-editors/roles",
"/demo-project-members/groups",
"/demo-project-members/roles",
"/demo-project-publishers/groups",
"/demo-project-publishers/roles"
Comment by Roman Kovařík [ 01/Apr/14 ]
  1. The tests in users workspace is still failing because pswd properties are not ignored.
    It would be also good if we don't have to explicitly specify paths. e.g.:
    "/demo-project-editors/groups",
    "/demo-project-editors/roles",
    "/demo-project-members/groups",
    "/demo-project-members/roles",
    "/demo-project-publishers/groups",
    "/demo-project-publishers/roles"
    

    and for example X/roles a /X/groups would be considered automatically for usergroups workspace so we wouldn't have to specify paths again when a new role would be added (if possible).

  2. Would be cool if empty ACL nodes would be considered same as missing ACL nodes:
    Expected presence of child node 'null' but was 'acl_config' - comparing  at null to <acl_config...> at /ROOT/admin/eric/acl_config
    

Otherwise really good! That's what we need

Comment by Robert Šiška [ 09/May/14 ]

XSLT now sorts the roles'/groups' IDs on user* workspaces and ignores pswd and lastaccess properties.

The Java code for comparing (linked to this ticket) is therefore useless but might have a use for other repositories...

If any problems related to this emerge, let's create a new more specific ticket.

Comment by Roman Kovařík [ 09/May/14 ]

Final commit:
http://git.magnolia-cms.com/gitweb/?p=modules/4-5-migration.git;a=commitdiff;h=6a72683a8d9b278a3750901a8f8054beb0478de3

Generated at Mon Feb 12 10:19:12 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.