Skip to content

Add integration tests for role assignments with same role on multiple scopes (Issue #513)#751

Open
MohidSheraz wants to merge 1 commit into
openstack-experimental:mainfrom
MohidSheraz:add-role-assignment-tests-issue-513
Open

Add integration tests for role assignments with same role on multiple scopes (Issue #513)#751
MohidSheraz wants to merge 1 commit into
openstack-experimental:mainfrom
MohidSheraz:add-role-assignment-tests-issue-513

Conversation

@MohidSheraz

Copy link
Copy Markdown
Collaborator

Closes #513

Added two integration tests to catch the bugs described in issue #513:

  • test_list_role_assignments_by_user_same_role_multiple_scopes

    • Assigns same role to user on 2 projects + system
    • Verifies listing by user_id returns all 3 assignments
  • test_list_role_assignments_by_role_id_same_role_multiple_scopes

    • Assigns same role to user on 2 projects + system
    • Verifies listing by role_id returns all 3 assignments

Both tests pass successfully.

@gtema gtema left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks.
apart of the other changes the commit message would need to be changed (use git commit --amend and specify a new message following the conventional commit summary (e.g., chore: Test role assignments with same role on multiple scopes)

Ok(())
}

// Add these two tests at the BOTTOM of:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this is likely the AI generated content and is making no sense here

assert!(
target_ids.contains(&project_2.id),
"Assignment on project_2 should be present"
);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

please also add explicit validation that the role is granted on the system scope

target_ids.contains(&project_2.id),
"Assignment on project_2 should be present when filtering by role_id"
);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

also here should verify that a role is present on the system scope, not only the project

@MohidSheraz MohidSheraz force-pushed the add-role-assignment-tests-issue-513 branch 4 times, most recently from 679cf1a to 0b593a8 Compare June 6, 2026 12:19
@MohidSheraz MohidSheraz force-pushed the add-role-assignment-tests-issue-513 branch from 0b593a8 to a99ed34 Compare June 6, 2026 13:24
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.

Add integration test for listing role assignments for particular user

2 participants