Skip to content

Commit

Permalink
Update api endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
MaartendeKruijf committed Sep 4, 2024
1 parent 49d6ddf commit 76c5200
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions routes/reporter/reporter_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ func parseCachePlaybookEntry(cacheEntry cache_model.ExecutionEntry) (api_model.P

executionReport := api_model.PlaybookExecutionReport{
Type: "execution_status",
Name: cacheEntry.Name,
Description: cacheEntry.Description,
ExecutionId: cacheEntry.ExecutionId.String(),
PlaybookId: cacheEntry.PlaybookId,
Started: cacheEntry.Started,
Expand Down Expand Up @@ -55,6 +57,8 @@ func parseCacheStepEntries(cacheStepEntries map[string]cache_model.StepResult) (
parsedEntries[stepId] = api_model.StepExecutionReport{
ExecutionId: stepEntry.ExecutionId.String(),
StepId: stepEntry.StepId,
Name: stepEntry.Name,
Description: stepEntry.Description,
Started: stepEntry.Started,
Ended: stepEntry.Ended,
Status: stepStatus,
Expand Down
3 changes: 3 additions & 0 deletions test/unittest/routes/reporter_api/reporter_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func TestGetExecutions(t *testing.T) {
Type: "execution_status",
ExecutionId: executionId.String(),
PlaybookId: "test",
Name: "ssh-test",
Started: expectedStarted,
Ended: expectedEnded,
Status: expectedStatus,
Expand Down Expand Up @@ -262,6 +263,7 @@ func TestGetExecutionReport(t *testing.T) {
"type":"execution_status",
"execution_id":"6ba7b810-9dad-11d1-80b4-00c04fd430c0",
"playbook_id":"test",
"name":"ssh-test",
"started":"2014-11-12T11:45:26.371Z",
"ended":"0001-01-01T00:00:00Z",
"status":"ongoing",
Expand All @@ -270,6 +272,7 @@ func TestGetExecutionReport(t *testing.T) {
"action--test":{
"execution_id":"6ba7b810-9dad-11d1-80b4-00c04fd430c0",
"step_id":"action--test",
"name":"ssh-tests",
"started":"2014-11-12T11:45:26.371Z",
"ended":"2014-11-12T11:45:26.371Z",
"status":"successfully_executed",
Expand Down

0 comments on commit 76c5200

Please sign in to comment.