Skip to content

Commit c1cfd75

Browse files
committed
feat(execution): add execution status to current-execution:get. fixes #275
1 parent 97a0b00 commit c1cfd75

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

src/base-execution-command.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,16 @@ const standardColumns = {
3737
header: 'Started At',
3838
get: formatTime('createdAt'),
3939
},
40+
status: {
41+
header: 'Execution Status',
42+
},
4043
trigger: {},
4144
}
4245

4346
class BaseExecutionCommand extends Command {
4447
outputCompleteTable (result, flags) {
4548
cli.table(result, {
4649
...standardColumns,
47-
status: {
48-
},
4950
currentStep: {
5051
header: 'Current/Failing Step Action',
5152
get: getLastStepAction,

test/commands/current-execution/get.test.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ test('get-current-execution - missing config', async () => {
3939
test('get-current-execution - configured', async () => {
4040
setCurrentOrgId('good')
4141

42-
expect.assertions(7)
42+
expect.assertions(8)
4343

4444
const runResult = GetCurrentExecution.run(['5', '--programId', '5'])
4545
await expect(runResult instanceof Promise).toBeTruthy()
@@ -49,6 +49,15 @@ test('get-current-execution - configured', async () => {
4949
await expect(mockSdk.getCurrentExecution.mock.calls.length).toEqual(1)
5050
await expect(mockSdk.getCurrentExecution).toHaveBeenCalledWith('5', '5')
5151

52+
await expect(Object.keys(cli.table.mock.calls[0][1])).toEqual([
53+
'pipelineId',
54+
'id',
55+
'createdAt',
56+
'status',
57+
'trigger',
58+
'currentStep',
59+
'currentStepStatus',
60+
])
5261
await expect(cli.table.mock.calls[0][1].currentStep.get(execution1010)).toEqual('Prod Deploy')
5362
await expect(cli.table.mock.calls[0][1].currentStepStatus.get(execution1010)).toEqual('WAITING')
5463
})

test/commands/pipeline/list-executions.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ test('list-executions -- success', async () => {
6969
'pipelineId',
7070
'id',
7171
'createdAt',
72-
'trigger',
7372
'status',
73+
'trigger',
7474
'currentStep',
7575
'currentStepStatus',
7676
])

0 commit comments

Comments
 (0)