Skip to content

Commit e7a19b2

Browse files
authored
chore: Add new integration tests for newly added one off task (#594)
* update tasks only feature * new integration tests * new integration tests with env variables defined * updated inputs * updated cluster inputs * updated region * Update test-workflow.yml * updated subnet values * updated values to link to my subnets, repo, cluster, and my service * update security group * modified workflow to add public IP and task definition with proper inputs * new task def file and yaml file changes * updated task def run task file with different container information * updated task def run task file with new cpu * new changes for integ tests with deploy task def credentials * updating task definition * updating env variables to inputs * updated region * updated env to both workflow files * removing env block * removing old commit and using commit from offical deploy repo * new echo integ test run no. * update original task definition * remove public IP input * keep only basic run task inputs * original inputs and different security group * final changes * made changes from comments * Delete .idea/.gitignore * Delete .idea/vcs.xml * Delete .idea/amazon-ecs-deploy-task-definition.iml * Delete .idea/inspectionProfiles/Project_Default.xml * Delete .idea/misc.xml * Delete .idea/modules.xml * clearer description name of each test
1 parent 457d9b4 commit e7a19b2

File tree

3 files changed

+73
-4
lines changed

3 files changed

+73
-4
lines changed

.github/workflows/test-workflow.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,33 @@ jobs:
2424
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
2525
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
2626
aws-region: us-west-2
27+
28+
- name: Deploy Amazon ECS task definition with one-off task and wait for task stopped set to false
29+
uses: aws-actions/amazon-ecs-deploy-task-definition@abe77ebded86b685c231c58bd5936280c6fcc011
30+
with:
31+
task-definition: task-definition-run-task.json
32+
cluster: github-actions-deploy-task-def-integ-test
33+
run-task: true
34+
run-task-subnets: subnet-e5604fce, subnet-fe9355b4, subnet-c49431bc, subnet-392f9b64
35+
run-task-security-groups: sg-067ebcde49c0f3ad8
36+
run-task-launch-type: FARGATE
37+
wait-for-task-stopped: false
38+
39+
- name: Deploy Amazon ECS task definition with one-off task and wait for task stopped set to true
40+
uses: aws-actions/amazon-ecs-deploy-task-definition@abe77ebded86b685c231c58bd5936280c6fcc011
41+
with:
42+
task-definition: task-definition-run-task.json
43+
cluster: github-actions-deploy-task-def-integ-test
44+
run-task: true
45+
run-task-subnets: subnet-e5604fce, subnet-fe9355b4, subnet-c49431bc, subnet-392f9b64
46+
run-task-security-groups: sg-067ebcde49c0f3ad8
47+
run-task-launch-type: FARGATE
48+
wait-for-task-stopped: true
2749

28-
- name: Deploy Amazon ECS task definition
50+
- name: Deploy Amazon ECS task definition with ECS Service
2951
uses: aws-actions/amazon-ecs-deploy-task-definition@abe77ebded86b685c231c58bd5936280c6fcc011
3052
with:
3153
task-definition: task-definition.json
3254
service: github-actions-deploy-task-def-integ-test
3355
cluster: github-actions-deploy-task-def-integ-test
34-
wait-for-service-stability: true
56+
wait-for-service-stability: true

task-definition-run-task.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"containerDefinitions": [
3+
{
4+
"memory": 32,
5+
"essential": true,
6+
"entryPoint": ["ping"],
7+
"name": "alpine_ping",
8+
"readonlyRootFilesystem": true,
9+
"image": "alpine:3.4",
10+
"command": [
11+
"-c",
12+
"4",
13+
"example.com"
14+
],
15+
"cpu": 16
16+
}
17+
],
18+
"memory": "512",
19+
"family": "github-actions-deploy-task-def-integ-tests",
20+
"requiresCompatibilities": [
21+
"FARGATE"
22+
],
23+
"networkMode": "awsvpc",
24+
"cpu": "256"
25+
}

test-workflow.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,32 @@ jobs:
2525
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
2626
aws-region: us-west-2
2727

28-
- name: Deploy Amazon ECS task definition
28+
- name: Deploy Amazon ECS task definition with one-off task and wait for task stopped set to false
29+
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
30+
with:
31+
task-definition: task-definition-run-task.json
32+
cluster: github-actions-deploy-task-def-integ-test
33+
run-task: true
34+
run-task-subnets: subnet-e5604fce, subnet-fe9355b4, subnet-c49431bc, subnet-392f9b64
35+
run-task-security-groups: sg-067ebcde49c0f3ad8
36+
run-task-launch-type: FARGATE
37+
wait-for-task-stopped: false
38+
39+
- name: Deploy Amazon ECS task definition with one-off task and wait for task stopped set to true
40+
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
41+
with:
42+
task-definition: task-definition-run-task.json
43+
cluster: github-actions-deploy-task-def-integ-test
44+
run-task: true
45+
run-task-subnets: subnet-e5604fce, subnet-fe9355b4, subnet-c49431bc, subnet-392f9b64
46+
run-task-security-groups: sg-067ebcde49c0f3ad8
47+
run-task-launch-type: FARGATE
48+
wait-for-task-stopped: true
49+
50+
- name: Deploy Amazon ECS task definition with ECS Service
2951
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
3052
with:
3153
task-definition: task-definition.json
3254
service: github-actions-deploy-task-def-integ-test
3355
cluster: github-actions-deploy-task-def-integ-test
34-
wait-for-service-stability: true
56+
wait-for-service-stability: true

0 commit comments

Comments
 (0)