Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add README for E2E test scripts (#1423)
Co-authored-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
- Loading branch information
1 parent
7783c69
commit f6f700d
Showing
3 changed files
with
122 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"Description": "Resources needed for SDK integration test", | ||
"Resources": { | ||
"IntegTestIdentityPool": { | ||
"Type": "AWS::Cognito::IdentityPool", | ||
"Properties": { | ||
"AllowUnauthenticatedIdentities": true, | ||
"CognitoIdentityProviders": [], | ||
"IdentityPoolName": "IntegTestIdentityPool" | ||
}, | ||
"Metadata": { | ||
"aws:cdk:path": "IntegTestResourcesStack/IntegTestIdentityPool" | ||
} | ||
}, | ||
"IntegTestIdentityPoolUnauthRole85D387D0": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": "sts:AssumeRoleWithWebIdentity", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Federated": "cognito-identity.amazonaws.com" | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
}, | ||
"ManagedPolicyArns": ["arn:aws:iam::aws:policy/AdministratorAccess"] | ||
}, | ||
"Metadata": { | ||
"aws:cdk:path": "IntegTestResourcesStack/IntegTestIdentityPoolUnauthRole/Resource" | ||
} | ||
}, | ||
"AttachUnauthRoleToIdentityPool": { | ||
"Type": "AWS::Cognito::IdentityPoolRoleAttachment", | ||
"Properties": { | ||
"IdentityPoolId": { | ||
"Ref": "IntegTestIdentityPool" | ||
}, | ||
"Roles": { | ||
"unauthenticated": { | ||
"Fn::GetAtt": ["IntegTestIdentityPoolUnauthRole85D387D0", "Arn"] | ||
} | ||
} | ||
}, | ||
"Metadata": { | ||
"aws:cdk:path": "IntegTestResourcesStack/AttachUnauthRoleToIdentityPool" | ||
} | ||
}, | ||
"IntegTestBucketA93771AE": { | ||
"Type": "AWS::S3::Bucket", | ||
"Properties": { | ||
"CorsConfiguration": { | ||
"CorsRules": [ | ||
{ | ||
"AllowedHeaders": ["*"], | ||
"AllowedMethods": ["GET", "PUT", "POST", "DELETE", "HEAD"], | ||
"AllowedOrigins": ["*"], | ||
"ExposedHeaders": ["ETag", "Date", "x-amz-request-id", "x-amz-id-2"], | ||
"MaxAge": 3000 | ||
} | ||
] | ||
} | ||
}, | ||
"UpdateReplacePolicy": "Retain", | ||
"DeletionPolicy": "Retain", | ||
"Metadata": { | ||
"aws:cdk:path": "IntegTestResourcesStack/IntegTestBucket/Resource" | ||
} | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
## Prerequisites | ||
|
||
1. You have a CloudFormation stack called `SdkReleaseV3IntegTestResourcesStack` in the AWS account you used to run the | ||
integration test. If not you can deploy the stack with: | ||
|
||
```console | ||
aws cloudformation deploy --stack-name SdkReleaseV3IntegTestResourcesStack --template-file ./IntegTestResourcesStack.template.json --capabilities CAPABILITY_IAM | ||
``` | ||
|
||
1. You have `ubuntu/standard/4.0` docker image built. If not, please follow [the guide to build the image](https://github.com/aws/aws-codebuild-docker-images#how-to-build-docker-images). | ||
|
||
## Steps | ||
|
||
1. Launch the image: | ||
|
||
```console | ||
docker run -it --entrypoint sh aws/codebuild/standard:4.0 -c bash | ||
``` | ||
|
||
Get 12-digit container ID by: | ||
|
||
```console | ||
docker container ls | ||
``` | ||
|
||
Note that you should run this command outside the launched container. | ||
|
||
1. Copy the working SDK repository into the container by: | ||
|
||
```console | ||
docker cp -a path/to/sdk [12-digit-container-id]:/path/to/working/dir | ||
``` | ||
|
||
1. Inside the container, configure the credentials to be the one that has permission to the `SdkReleaseV3IntegTestResourcesStack` | ||
stack. Region also needs to be configured. You can configure the credentials and region following | ||
[this guide](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html). | ||
|
||
1. Change directory to the SDK directory, make sure the clients that contains end-to-end test suites has been built to | ||
JS files. | ||
|
||
1. Run the end-to-end test suite from the SDK root: | ||
|
||
```console | ||
yarn test:e2e | ||
``` |