Skip to content

Commit

Permalink
chore: Add new integration tests for newly added one off task (#594)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
shesaave authored Jul 31, 2024
1 parent 457d9b4 commit e7a19b2
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 4 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,33 @@ jobs:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2

- name: Deploy Amazon ECS task definition with one-off task and wait for task stopped set to false
uses: aws-actions/amazon-ecs-deploy-task-definition@abe77ebded86b685c231c58bd5936280c6fcc011
with:
task-definition: task-definition-run-task.json
cluster: github-actions-deploy-task-def-integ-test
run-task: true
run-task-subnets: subnet-e5604fce, subnet-fe9355b4, subnet-c49431bc, subnet-392f9b64
run-task-security-groups: sg-067ebcde49c0f3ad8
run-task-launch-type: FARGATE
wait-for-task-stopped: false

- name: Deploy Amazon ECS task definition with one-off task and wait for task stopped set to true
uses: aws-actions/amazon-ecs-deploy-task-definition@abe77ebded86b685c231c58bd5936280c6fcc011
with:
task-definition: task-definition-run-task.json
cluster: github-actions-deploy-task-def-integ-test
run-task: true
run-task-subnets: subnet-e5604fce, subnet-fe9355b4, subnet-c49431bc, subnet-392f9b64
run-task-security-groups: sg-067ebcde49c0f3ad8
run-task-launch-type: FARGATE
wait-for-task-stopped: true

- name: Deploy Amazon ECS task definition
- name: Deploy Amazon ECS task definition with ECS Service
uses: aws-actions/amazon-ecs-deploy-task-definition@abe77ebded86b685c231c58bd5936280c6fcc011
with:
task-definition: task-definition.json
service: github-actions-deploy-task-def-integ-test
cluster: github-actions-deploy-task-def-integ-test
wait-for-service-stability: true
wait-for-service-stability: true
25 changes: 25 additions & 0 deletions task-definition-run-task.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"containerDefinitions": [
{
"memory": 32,
"essential": true,
"entryPoint": ["ping"],
"name": "alpine_ping",
"readonlyRootFilesystem": true,
"image": "alpine:3.4",
"command": [
"-c",
"4",
"example.com"
],
"cpu": 16
}
],
"memory": "512",
"family": "github-actions-deploy-task-def-integ-tests",
"requiresCompatibilities": [
"FARGATE"
],
"networkMode": "awsvpc",
"cpu": "256"
}
26 changes: 24 additions & 2 deletions test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,32 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2

- name: Deploy Amazon ECS task definition
- name: Deploy Amazon ECS task definition with one-off task and wait for task stopped set to false
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: task-definition-run-task.json
cluster: github-actions-deploy-task-def-integ-test
run-task: true
run-task-subnets: subnet-e5604fce, subnet-fe9355b4, subnet-c49431bc, subnet-392f9b64
run-task-security-groups: sg-067ebcde49c0f3ad8
run-task-launch-type: FARGATE
wait-for-task-stopped: false

- name: Deploy Amazon ECS task definition with one-off task and wait for task stopped set to true
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: task-definition-run-task.json
cluster: github-actions-deploy-task-def-integ-test
run-task: true
run-task-subnets: subnet-e5604fce, subnet-fe9355b4, subnet-c49431bc, subnet-392f9b64
run-task-security-groups: sg-067ebcde49c0f3ad8
run-task-launch-type: FARGATE
wait-for-task-stopped: true

- name: Deploy Amazon ECS task definition with ECS Service
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: task-definition.json
service: github-actions-deploy-task-def-integ-test
cluster: github-actions-deploy-task-def-integ-test
wait-for-service-stability: true
wait-for-service-stability: true

0 comments on commit e7a19b2

Please sign in to comment.