Skip to content

Commit 450a239

Browse files
committed
Re-use run-task with options test
1 parent 75be5b8 commit 450a239

File tree

1 file changed

+2
-33
lines changed

1 file changed

+2
-33
lines changed

index.test.js

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@ describe('Deploy to ECS', () => {
11551155
.mockReturnValueOnce('') // wait-for-minutes
11561156
.mockReturnValueOnce('') // force-new-deployment
11571157
.mockReturnValueOnce('') // desired-count
1158-
.mockReturnValueOnce('') // enable-ecs-managed-tags
1158+
.mockReturnValueOnce('true') // enable-ecs-managed-tags
11591159
.mockReturnValueOnce('true') // run-task
11601160
.mockReturnValueOnce('false') // wait-for-task-stopped
11611161
.mockReturnValueOnce('someJoe') // run-task-started-by
@@ -1176,7 +1176,7 @@ describe('Deploy to ECS', () => {
11761176
taskDefinition: 'task:def:arn',
11771177
overrides: { containerOverrides: [{ name: 'someapp', command: 'somecmd' }] },
11781178
networkConfiguration: { awsvpcConfiguration: { subnets: ['a', 'b'], securityGroups: ['c', 'd'], assignPublicIp: "DISABLED" } },
1179-
enableECSManagedTags: false
1179+
enableECSManagedTags: true
11801180
});
11811181
expect(core.setOutput).toHaveBeenNthCalledWith(2, 'run-task-arn', ["arn:aws:ecs:fake-region:account_id:task/arn"]);
11821182
});
@@ -1446,35 +1446,4 @@ describe('Deploy to ECS', () => {
14461446
expect(core.setFailed).toHaveBeenNthCalledWith(1, 'Failed to register task definition in ECS: Could not parse');
14471447
expect(core.setFailed).toHaveBeenNthCalledWith(2, 'Could not parse');
14481448
});
1449-
1450-
test('deployment with enable-ecs-managed-tags', async () => {
1451-
core.getInput = jest
1452-
.fn()
1453-
.mockReturnValueOnce('task-definition.json') // task-definition
1454-
.mockReturnValueOnce('service-456') // service
1455-
.mockReturnValueOnce('cluster-789') // cluster
1456-
.mockReturnValueOnce('false') // wait-for-service-stability
1457-
.mockReturnValueOnce('') // wait-for-minutes
1458-
.mockReturnValueOnce('') // force-new-deployment
1459-
.mockReturnValueOnce('1') // desired count is number
1460-
.mockReturnValueOnce('true'); // enable-
1461-
1462-
await run();
1463-
expect(core.setFailed).toHaveBeenCalledTimes(0);
1464-
1465-
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family' });
1466-
expect(core.setOutput).toHaveBeenNthCalledWith(1, 'task-definition-arn', 'task:def:arn');
1467-
expect(mockEcsDescribeServices).toHaveBeenNthCalledWith(1, {
1468-
cluster: 'cluster-789',
1469-
services: ['service-456']
1470-
});
1471-
expect(mockEcsUpdateService).toHaveBeenNthCalledWith(1, {
1472-
cluster: 'cluster-789',
1473-
desiredCount: 1,
1474-
service: 'service-456',
1475-
taskDefinition: 'task:def:arn',
1476-
forceNewDeployment: false,
1477-
enableECSManagedTags: true
1478-
});
1479-
});
14801449
});

0 commit comments

Comments
 (0)