To run any types of test rather than the mock folder
, the testing framework will need to create resources in your aws account.
there're some basic components needed before run the tests.
Refer to: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html
Please ensure the default profile in your ~/.aws/credentials has Admin permission.
Setup only needs to be run once, it creates:
- one iam role
- one vpc
- one security group
- two ecr repos, one for sample apps, one for mocked server
- one amazon managed service for prometheus endpoint.
- one s3 bucket, one dynamodb table
cd aws-otel-test-framework/terraform/setup
terraform init
terraform apply
###2.1 Share Setup resources (Optional) Prerequisite:
- you are required to run the setup basic components once if you and other developers did not setup these components before.
- Uncomment the backend configuration to share the setup's terraform state
Advantage:
- Avoid creating duplicate resources on the same account and having duplicate-resources error when running test case such as VPC.
- Sharing up-to-date resource with other developers instead of creating required resources from scratch.
cd aws-otel-test-framework/terraform/setup
terraform init
terraform apply
this step might take 20 minutes, it builds and pushes the sample apps and mocked server images to the ecr repos, so that the following test could use them.
cd aws-otel-test-framework/terraform/imagebuild
terraform init
terraform apply
Remember, if you have changes on sample apps or the mocked server, you need to rerun this imagebuild task.