Skip to content

Commit

Permalink
GitHub Action should print skipped tasks in logs (#153)
Browse files Browse the repository at this point in the history
Signed-off-by: Gloria Delgado <gloriad@vmware.com>
  • Loading branch information
gdelgadot committed May 10, 2023
1 parent 20f8971 commit 97c60fc
Show file tree
Hide file tree
Showing 4 changed files with 494 additions and 28 deletions.
7 changes: 5 additions & 2 deletions __tests__/src/action.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ describe('Given an Action', () => {
it('When some tasks fail during the execution check then a log is printed once', async () => {
const cypressFailed = taskMother.cypress(undefined, TaskStatus.Failed)
const deployFailed = taskMother.deployment(undefined, TaskStatus.Failed, cypressFailed.task_id)
const executionGraph: ExecutionGraph = executionGraphMother.empty(undefined, TaskStatus.InProgress, [ deployFailed, cypressFailed ])
const cypressSkipped = taskMother.cypress(undefined, TaskStatus.Skipped)
const executionGraph: ExecutionGraph = executionGraphMother.empty(undefined, TaskStatus.InProgress, [ deployFailed, cypressFailed, cypressSkipped ])
jest.spyOn(action.vib, 'validatePipeline').mockResolvedValue([])
jest.spyOn(action.vib, 'createPipeline').mockResolvedValue(executionGraph.execution_graph_id)
jest.spyOn(action.vib, 'getExecutionGraph')
Expand All @@ -280,9 +281,11 @@ describe('Given an Action', () => {

await action.runPipeline(pipelineMother.valid())

expect(core.error).toBeCalledTimes(2)
expect(core.error).toBeCalledTimes(3)
expect(core.error).toHaveBeenNthCalledWith(1, 'Task deployment (cypress) with ID 413e631d-0692-48de-ad4e-3962620b8f40 has failed. Error: undefined')
expect(core.error).toHaveBeenNthCalledWith(2, 'Task cypress with ID d426abec-4d9e-44d1-b540-0448197d5651 has failed. Error: undefined')
expect(core.error).toHaveBeenNthCalledWith(3, 'Task cypress with ID d426abec-4d9e-44d1-b540-0448197d5651 was skipped. Error: undefined')

})
})

Expand Down
Loading

0 comments on commit 97c60fc

Please sign in to comment.