Skip to content

Commit 9ec87c7

Browse files
committed
Add test for API actions log download
1 parent 3d45dc9 commit 9ec87c7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/integration/actions_log_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,20 @@ jobs:
149149
)
150150
}
151151

152+
// download task logs from API and check content
153+
req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/%s/actions/runs/%s/jobs/0/logs", user2.Name, repo.Name, runIndex)).
154+
AddTokenAuth(token)
155+
resp = MakeRequest(t, req, http.StatusOK)
156+
logTextLines = strings.Split(strings.TrimSpace(resp.Body.String()), "\n")
157+
assert.Len(t, logTextLines, len(tc.outcome.logRows))
158+
for idx, lr := range tc.outcome.logRows {
159+
assert.Equal(
160+
t,
161+
fmt.Sprintf("%s %s", lr.Time.AsTime().Format("2006-01-02T15:04:05.0000000Z07:00"), lr.Content),
162+
logTextLines[idx],
163+
)
164+
}
165+
152166
resetFunc()
153167
})
154168
}

0 commit comments

Comments
 (0)