This project is a testing framework which could be used in both SDK repo and AOC repo, it covers multiple aws platforms as well as multiple language sdk sample apps.
before adding a new component into AOC, we require contributor to add a new testing suite in this framework.
please check https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html
please check https://learn.hashicorp.com/tutorials/terraform/install-cli
Setup only needs to be run once, it creates
- one iam role
- one vpc
- one security group
- one s3 bucket which used to store the ssh key for ec2 login
run
cd terraform/setup && terraform init && terraform apply
1.4 [Optional] Create a PR to AOC Repo and record the version number
This is optional item, only do it if your goal is to add a component or fix a bug into the AOC Repo. Everytime when you create a PR to AOC repo, there will be a workflow to be running in this PR to do regression test and also, build testing artifacts[rpm, image, etc] for your code. Every PR will have a separate version number which you will be able to use it in the testing framework to verify whether your new code can pass your new testing suite.
-
create a branch in AOC Repo. [please don't fork at this moment, just create a branch directly in the AOC Repo]. [todo, after the repo becomes public, you can use fork instead of creating branch]
-
create a PR to merge the new branch to the
main
branch. -
Waiting for the workflow checking in the PR to be finished.
-
find out the version number, click into the workflow page, click
e2etest-preparation
step, and clickVersioning for testing
, record the version number. Ex(v0.1.12-299946851). -
provide your testing aws account id to Ying(wangmyin@), so that he will give permission to your aws account to fetch the testing image from a private ECR. [todo, once we migrate to dockerhub, you don't need this step]
cd terraform/ecs && terraform init && terraform apply -var-file="../testing-suites/statsd-ecs.tfvars"
cd terraform/ecs && terraform init && terraform apply -var-file="../testing-suites/statsd-ecs.tfvars" -var="aoc_version={the version you got from workflow}"
cd terraform/ecs && terraform destory"
cd terraform/ec2 && terraform init && terraform apply -var="sshkey_s3_bucket={the bucket name you set in setup}" -var-file="../testing-suites/statsd-ec2.tfvars"
cd terraform/ec2 && terraform init && terraform apply -var="sshkey_s3_bucket={the bucket name you set in setup}" -var-file="../testing-suites/statsd-ec2.tfvars" -var="aoc_version={the version you got from workflow}"
cd terraform/ec2 && terraform destory"
create a eks cluster in your account before run below command
cd terraform/eks && terraform init && terraform apply -var="eks_cluster_name={the eks cluster name in your account}" -var-file="../testing-suites/statsd-eks.tfvars"
cd terraform/eks && terraform init && terraform apply -var="eks_cluster_name={the eks cluster name in your account}" -var-file="../testing-suites/statsd-eks.tfvars" -var="aoc_version={the version you got from workflow}"
cd terraform/eks && terraform destroy
please check adding a testing suite
We have collected notes on how to contribute to this project in CONTRIBUTING.md.
See CONTRIBUTING for more information.
This project is licensed under the Apache-2.0 License.