This repository was archived by the owner on Mar 23, 2026. It is now read-only.
Migrate moto IAM role tests#13749
Merged
Merged
Conversation
Test Results - Preflight, Unit23 099 tests 21 237 ✅ 6m 7s ⏱️ Results for commit 7c04148. ♻️ This comment has been updated with latest results. |
Test Results (amd64) - Acceptance7 tests 5 ✅ 3m 2s ⏱️ Results for commit 7c04148. ♻️ This comment has been updated with latest results. |
Test Results (amd64) - Integration, Bootstrap 5 files 5 suites 9m 26s ⏱️ Results for commit 7c04148. ♻️ This comment has been updated with latest results. |
1eedc7e to
540a735
Compare
a2a079c to
37f4eb0
Compare
540a735 to
7c04148
Compare
dfangl
added a commit
that referenced
this pull request
Feb 16, 2026
dfangl
added a commit
that referenced
this pull request
Feb 17, 2026
dfangl
added a commit
that referenced
this pull request
Feb 19, 2026
dfangl
added a commit
that referenced
this pull request
Feb 26, 2026
dfangl
added a commit
that referenced
this pull request
Feb 26, 2026
dfangl
added a commit
that referenced
this pull request
Mar 4, 2026
dfangl
added a commit
that referenced
this pull request
Mar 6, 2026
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Motivation
For our migration of IAM from moto into the LS codebase, we need to cover the same behvaior in our tests.
This PR migrates the tests for IAM roles (and their interactions with policies, etc.)
Changes
Migration Summary
test_role_errorstest_get_role__should_throw__when_role_does_not_exist,test_create_role_with_same_name_should_failtest_create_role_defaultstest_create_role_defaults,test_create_role_no_pathtest_delete_role_with_attached_policytest_delete_role(managed policy section)test_delete_role_with_inline_policytest_delete_role(inline policy section)test_update_roletest_update_role,test_update_role_description,test_update_role_defaultstest_update_assume_role_policy_errorstest_update_assume_role_invalid_policy,test_update_assume_role_invalid_policy_bad_action,test_update_assume_role_invalid_policy_with_resourcetest_list_roles_path_prefixtest_list_roles_path_prefix_value_adhered,test_list_roles_none_found_returns_empty_listtest_role_permissions_boundarytest_create_role_with_permissions_boundary(create, get, put, delete boundary)test_role_permissions_boundary_errorstest_create_role_with_permissions_boundary(error cases)test_role_inline_policy_lifecycletest_list_role_policies,test_put_role_policy,test_get_role_policytest_role_managed_policy_lifecycletest_attach_detach_role_policytest_role_managed_policy_errorstest_only_detach_role_policytest_role_with_tagstest_create_role_with_tags(partial)test_role_tag_operationstest_tag_role,test_untag_roletest_role_tag_errorstest_tag_role(error cases),test_untag_role(error cases)test_list_roles_paginationtest_list_roles_max_item_and_marker_values_adhered,test_list_roles_path_prefix_value_adhered,test_list_roles_none_found_returns_empty_list,test_list_rolesDetailed Mapping
TestRoleLifecycle
test_role_errorstest_get_role__should_throw__when_role_does_not_exist(line 167),test_create_role_with_same_name_should_fail(line 3345)test_create_role_defaultstest_create_role_defaults(line 2721),test_create_role_no_path(line 3193)test_delete_role_with_attached_policytest_delete_role(line 352, managed policy section)test_delete_role_with_inline_policytest_delete_role(line 352, inline policy section)test_update_roletest_update_role(line 3044),test_update_role_description(line 3029),test_update_role_defaults(line 3058)test_update_assume_role_policy_errorstest_update_assume_role_invalid_policy(line 528),test_update_assume_role_invalid_policy_bad_action(line 556),test_update_assume_role_invalid_policy_with_resource(line 589)test_list_roles_path_prefixtest_list_roles_path_prefix_value_adhered(line 4727),test_list_roles_none_found_returns_empty_list(line 4746)TestRolePermissionsBoundary
test_role_permissions_boundary_lifecycletest_create_role_with_permissions_boundary(line 3301)test_role_permissions_boundary_errorstest_create_role_with_permissions_boundary(line 3301, error section)TestRoleInlinePolicies
test_role_inline_policy_lifecycletest_list_role_policies(line 474),test_put_role_policy(line 504),test_get_role_policy(line 518)TestRoleManagedPolicies
test_role_managed_policy_lifecycletest_attach_detach_role_policy(line 2184)test_role_managed_policy_errorstest_only_detach_role_policy(line 2274)TestRoleTags
test_role_with_tagstest_create_role_with_tags(line 2734, partial)test_role_tag_operationstest_tag_role(line 2841),test_untag_role(line 2970)test_role_tag_errorstest_create_role_with_tags(line 2734, error section),test_tag_role(line 2841, error section),test_untag_role(line 2970, error section)TestRolePagination
test_list_roles_paginationtest_list_roles_max_item_and_marker_values_adhered(line 4707),test_list_roles_path_prefix_value_adhered(line 4727),test_list_roles_none_found_returns_empty_list(line 4746),test_list_roles(line 4767)Tests NOT Migrated (Already Exist or Excluded)
Already Exist in test_iam.py
test_create_role_with_malformed_assume_role_policy_documenttest_iam.py:149test_role_with_path_lifecycletest_iam.py:174test_recreate_iam_roletest_iam.py:253test_create_role_with_same_name_should_fail)test_update_assume_role_policytest_iam.py:603test_create_describe_roletest_iam.py:636test_list_roles_with_permission_boundarytest_iam.py:667test_attach_detach_role_policytest_iam.py:383test_role_attach_policytest_iam.py:718test_put_role_policy_encodingtest_iam.py:847Not Applicable
test_get_role__should_contain_last_usedtest_role_list_config_discovered_resourcestest_role_config_dicttest_role_config_clienttest_list_roles_with_more_than_100_roles_no_max_items_defaults_to_100Overall counts
Tests
All tests have been manually checked to cover the same behavior as moto does
Related
Closes UNC-216