-
Notifications
You must be signed in to change notification settings - Fork 90
Wirej/aws sdk v3 amplify e2e tests #3349
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
Wirej/aws sdk v3 amplify e2e tests #3349
Conversation
- Update package.json dependencies from aws-sdk v2 to v3 clients - Migrate all AWS service imports and usage patterns: - S3Client, IAMClient, CognitoIdentityProviderClient - CloudFormationClient, STSClient, OrganizationsClient - CodeBuildClient, AmplifyClient - Update method calls (remove .promise(), use send() with commands) - Fix type definitions for OAuth flows and other Cognito types - Create compatibility layer for deleteS3Bucket function - Update imports in 7 files with AWS SDK usage - All TypeScript compilation successful Files updated: - src/cleanup-e2e-resources.ts (major refactor) - src/cleanup-stale-test-buckets.ts - src/schema-api-directives/authHelper.ts - src/import-helpers/utilities.ts - src/import-helpers/types.ts - src/aws-matchers/s3matcher.ts - src/aws-matchers/iamMatcher.ts
…sons - Fix type mismatch in DynamoDBModelTransformer, KeyTransformer, and ModelConnectionTransformer - Convert getTransformerVersion() result to Number for comparison with CONDITIONS_MINIMUM_VERSION
- Pin amplify-e2e-tests AWS SDK versions to ~3.600.0 - Avoids Jest compatibility issues with node: prefixed imports - Maintains AWS SDK v3 benefits while ensuring test compatibility - TODO: Upgrade to latest versions after Jest config updates
…tion - Fix AWSAccountInfo type to use fromTemporaryCredentials - Replace manual STS assume role with fromTemporaryCredentials - Update all AWS client instantiations to use simplified credentials - Fix S3 bucket deletion to use v2 client for e2e-core compatibility - Remove broken getAWSConfig function This addresses the cleanup_e2e_resources build failures by reverting to the working credential approach from main branch while maintaining compatibility with current e2e-core package.
- Migrate deleteS3Bucket function in e2e-core to use AWS SDK v3 S3Client - Add @aws-sdk/client-s3 dependency to e2e-core package - Remove aws-sdk v2 import from cleanup script - Update cleanup script to use v3 S3Client directly with deleteS3Bucket - Fix type compatibility issues between S3Client versions This completes the migration by ensuring every file in amplify-e2e-tests package uses AWS SDK v3 fully, with no v2 dependencies remaining.
- Migrate cleanup-stale-test-buckets.ts to use v3 S3Client with deleteS3Bucket - Migrate auth-migration.test.ts to use v3 IAMClient - Migrate custom_policies_container.test.ts to use v3 SSMClient with send() pattern - Migrate predictions-usage.ts to use v3 S3Client with PutObjectCommand - Add missing @aws-sdk/client-ssm dependency - Fix ACL type compatibility for PutObjectCommand All files in amplify-e2e-tests package now use AWS SDK v3 exclusively. No aws-sdk v2 imports remain in the package.
…entRedirect error
…s-usage.ts - Remove duplicate imports and function declarations that were causing TypeScript compilation errors - Keep the corrected version with regionalized S3Client and GetBucketLocationCommand import
- Remove ACL parameter from S3 upload in predictions-usage.ts to fix AccessControlListNotSupported error - Fix DynamoDB error message format in getDDBTable to ensure message property is enumerable for Object.assign in tests
- Change e?.code to e?.name for UnrecognizedClientException and InvalidClientTokenId - Update console.log messages to use e?.name instead of e?.code - Fixes cleanup_e2e_resources failures due to incorrect error property access
…anup - change e.code to e.name for AWS SDK v3 compatibility - fixes NoSuchTagSet error in cleanup process - updates all error handling patterns in cleanup script
- add @aws-sdk/util-dynamodb dependency - use marshall() to convert plain objects to DynamoDB attribute format - fixes TypeError in putItemInTable function for AWS SDK v3 compatibility
- use transformToString() method for S3 GetObjectCommand response body - fixes stream reading compatibility issue in schema-iterative-update-locking test - resolves retry-able function predicate constraint error
|
✅ Tests : https://tiny.amazon.com/cc6fy5ds/IsenLink |
| compute-type: BUILD_GENERAL1_MEDIUM | ||
| variables: | ||
| JSII_DEPRECATED: 'quiet' | ||
| JSII_DEPRECATED: quiet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unclear to me whether this is intrinsic to the upgrade. Q did this while troubleshooting e2e failures, and I'm inclined to keep the change unless it's proven wrong.
- replace CodeBuild and CloudWatchLogs with v3 clients - update SharedIniFileCredentials to fromIni credential provider - remove .promise() calls and use command pattern - add required @AWS-SDK dependencies to scripts package.json
ShadowCat567
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one of these comments is something actionable and it is optional whether you want to pursue it since the current implementation works fine
Description of changes
Migrates amplify-e2e-tests and amplify-e2e-core packages from AWS SDK v2 to v3, resolving compatibility issues in
the e2e test infrastructure.
CDK / CloudFormation Parameters Changed
Issue #, if available
Description of how you validated changes
✅ PR Checks
✅ E2E Tests
Checklist
yarn testpassesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.