Skip to content
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

fix: Add sso credentials integration test #1129

Merged
merged 14 commits into from
Sep 21, 2023

Conversation

sichanyoo
Copy link
Contributor

Issue #

N/A

Description of changes

Adds integration test for SSOCredentialsProvider that uses S3::listBuckets.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@sichanyoo sichanyoo changed the title Fix: Add sso credentials integration test fix: Add sso credentials integration test Sep 18, 2023
Copy link
Contributor

@jbelkins jbelkins left a comment

Choose a reason for hiding this comment

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

Nothing huge, just a few small issues to address

managedPolicyArn: awsReadOnlyPolicy,
permissionSetArn: permissionSetArn))
} catch let error as AWSSSOAdmin.ConflictException {
if error.message == "PermissionSet with name \(permissionSetName) already exists." {
Copy link
Contributor

Choose a reason for hiding this comment

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

Assume error messages can change at any time. Is there a more reliable way to verify this error condition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently there's no other way to check the specific cause for the error other than checking the message contained int he error. So as a workaround I now look for smaller substring using contains() to reduce dependency on the entire error message string staying the same. Now it only checks that \(permissionSetName) already exists is part of the error message.

@awslabs awslabs deleted a comment from sichanyoo Sep 20, 2023
@sichanyoo sichanyoo requested a review from jbelkins September 20, 2023 20:52
Copy link
Contributor

@dayaffe dayaffe left a comment

Choose a reason for hiding this comment

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

Logic looks good but would like to clean up large helper function

@sichanyoo sichanyoo requested a review from dayaffe September 20, 2023 21:19
@sichanyoo sichanyoo requested a review from dayaffe September 20, 2023 22:22
Copy link
Contributor

@dayaffe dayaffe left a comment

Choose a reason for hiding this comment

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

LGTM

@sichanyoo
Copy link
Contributor Author

/test

@sichanyoo sichanyoo merged commit 98068e1 into main Sep 21, 2023
10 checks passed
@sichanyoo sichanyoo deleted the fix/add-sso-credentials-integration-tests branch September 21, 2023 23:47
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.

3 participants