Skip to content

Commit 5d7c6e8

Browse files
authored
Add EKS Fargate Container Insights Tests (#789)
1 parent 45ff85f commit 5d7c6e8

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed

.github/workflows/CI.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,7 @@ jobs:
551551
runs-on: ubuntu-latest
552552
outputs:
553553
eks-matrix: ${{ steps.set-matrix.outputs.eks-matrix }}
554+
eks-fargate-matrix: ${{ steps.set-matrix.outputs.eks-fargate-matrix }}
554555
eks-adot-operator-matrix: ${{ steps.set-matrix.outputs.eks-adot-operator-matrix }}
555556
ecs-matrix: ${{ steps.set-matrix.outputs.ecs-matrix }}
556557
ec2-matrix-1: ${{ steps.set-matrix.outputs.ec2-matrix-1 }}
@@ -573,6 +574,7 @@ jobs:
573574
eks_matrix=$(python e2etest/get-testcases.py eks_matrix)
574575
eks_adot_operator_matrix=$(python e2etest/get-testcases.py eks_adot_operator_matrix)
575576
echo "::set-output name=eks-matrix::$eks_matrix"
577+
echo "::set-output name=eks-fargate-matrix::$eks_matrix"
576578
echo "::set-output name=eks-adot-operator-matrix::$eks_adot_operator_matrix"
577579
echo "::set-output name=ecs-matrix::$ecs_matrix"
578580
echo "::set-output name=ec2-matrix-1::$ec2_matrix_1"
@@ -581,6 +583,7 @@ jobs:
581583
- name: List testing suites
582584
run: |
583585
echo ${{ steps.set-matrix.outputs.eks-matrix }}
586+
echo ${{ steps.set-matrix.outputs.eks-fargate-matrix }}
584587
echo ${{ steps.set-matrix.outputs.eks-adot-operator-matrix }}
585588
echo ${{ steps.set-matrix.outputs.ecs-matrix }}
586589
echo ${{ steps.set-matrix.outputs.ec2-matrix-1 }}
@@ -881,6 +884,61 @@ jobs:
881884
run: |
882885
cd testing-framework/terraform/eks && terraform destroy -auto-approve
883886
887+
e2etest-eks-fargate:
888+
runs-on: ubuntu-latest
889+
needs: [get-testing-suites, e2etest-release, e2etest-preparation]
890+
strategy:
891+
fail-fast: false
892+
max-parallel: 1
893+
matrix: ${{ fromJson(needs.get-testing-suites.outputs.eks-fargate-matrix) }}
894+
895+
steps:
896+
- uses: actions/checkout@v2
897+
898+
- name: Cache if success
899+
id: e2etest-eks-fargate
900+
uses: actions/cache@v2
901+
with:
902+
path: |
903+
VERSION
904+
key: e2etest-eks-fargate-${{ github.run_id }}-${{ matrix.testcase }}
905+
906+
- name: Configure AWS Credentials
907+
if: steps.e2etest-eks-fargate.outputs.cache-hit != 'true'
908+
uses: aws-actions/configure-aws-credentials@v1
909+
with:
910+
aws-access-key-id: ${{ secrets.INTEG_TEST_AWS_KEY_ID }}
911+
aws-secret-access-key: ${{ secrets.INTEG_TEST_AWS_KEY_SECRET }}
912+
aws-region: us-west-2
913+
914+
- name: Set up JDK 1.11
915+
if: steps.e2etest-eks-fargate.outputs.cache-hit != 'true'
916+
uses: actions/setup-java@v1
917+
with:
918+
java-version: 1.11
919+
920+
- name: Set up terraform
921+
if: steps.e2etest-eks-fargate.outputs.cache-hit != 'true'
922+
uses: hashicorp/setup-terraform@v1
923+
924+
- name: Check out testing framework
925+
if: steps.e2etest-eks-fargate.outputs.cache-hit != 'true'
926+
uses: actions/checkout@v2
927+
with:
928+
repository: 'aws-observability/aws-otel-collector-test-framework'
929+
path: testing-framework
930+
931+
- name: Run testing suite on eks
932+
if: steps.e2etest-eks-fargate.outputs.cache-hit != 'true'
933+
run: |
934+
if [[ -f testing-framework/terraform/testcases/${{ matrix.testcase }}/parameters.tfvars ]] ; then opts="-var-file=../testcases/${{ matrix.testcase }}/parameters.tfvars" ; else opts="" ; fi
935+
cd testing-framework/terraform/eks && terraform init && terraform apply -auto-approve -lock=false $opts -var="aoc_version=${{ needs.e2etest-preparation.outputs.version }}" -var="testcase=../testcases/${{ matrix.testcase }}"
936+
937+
- name: Destroy resources
938+
if: ${{ always() && steps.e2etest-eks-fargate.outputs.cache-hit != 'true' }}
939+
run: |
940+
cd testing-framework/terraform/eks && terraform destroy -auto-approve -var-file="../testcases/${{ matrix.testcase }}/parameters.tfvars"
941+
884942
e2etest-eks-adot-operator:
885943
runs-on: ubuntu-latest
886944
needs: [get-testing-suites, e2etest-release, e2etest-preparation]

e2etest/get-testcases.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
]}
3434
ecs_matrix = {"testcase": [], "launch_type": ["EC2", "FARGATE"]}
3535
eks_matrix = {"testcase": []}
36+
eks_fargate_matrix = {"testcase": []}
3637
eks_adot_operator_matrix = {"testcase": []}
3738
local_matrix = {"testcase": []}
3839
soaking_matrix = {"testcase": [], "testing_ami": ["soaking_linux", "soaking_windows"]}
@@ -46,6 +47,7 @@
4647
"ec2_matrix_3": ec2_matrix_3,
4748
"ecs_matrix": ecs_matrix,
4849
"eks_matrix": eks_matrix,
50+
"eks_fargate_matrix": eks_fargate_matrix,
4951
"eks_adot_operator_matrix": eks_adot_operator_matrix,
5052
"local_matrix": local_matrix,
5153
"soaking_matrix": soaking_matrix,
@@ -65,6 +67,8 @@
6567
ecs_matrix["testcase"].append(testcase["case_name"])
6668
if 'EKS' in testcase["platforms"]:
6769
eks_matrix["testcase"].append(testcase["case_name"])
70+
if 'EKS_FARGATE' in testcase["platforms"]:
71+
eks_fargate_matrix["testcase"].append(testcase["case_name"])
6872
if 'EKS_ADOT_OPERATOR' in testcase["platforms"]:
6973
eks_adot_operator_matrix["testcase"].append(testcase["case_name"])
7074
if 'LOCAL' in testcase["platforms"]:

e2etest/testcases.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,13 @@
134134
{
135135
"case_name": "ecs_instance_metrics",
136136
"platforms": ["ECS"]
137+
},
138+
{
139+
"case_name": "eks_containerinsights_fargate",
140+
"platforms": ["EKS_FARGATE"]
141+
},
142+
{
143+
"case_name": "eks_containerinsights_fargate_metric",
144+
"platforms": ["EKS_FARGATE"]
137145
}
138146
]

0 commit comments

Comments
 (0)