Skip to content

Commit

Permalink
Merge branch 'main' into vsukhin/feature/cronjob-config
Browse files Browse the repository at this point in the history
  • Loading branch information
vsukhin committed Oct 29, 2024
2 parents e7d2398 + 806d787 commit ccd9e99
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions cmd/kubectl-testkube/commands/testworkflows/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ func printRawLogLines(logs []byte, steps []testkube.TestWorkflowSignature, resul
logs = nil
} else {
line = string(logs[:newLineIndex])
logs = logs[newLineIndex+1:]
logs = logs[newLineIndex+len(NL):]
}

line = trimTimestamp(line)
Expand All @@ -354,28 +354,34 @@ func printRawLogLines(logs []byte, steps []testkube.TestWorkflowSignature, resul

nextRef := start[1]

for i == -1 || steps[i].Ref != nextRef {
for i == -1 || (i < len(steps) && steps[i].Ref != nextRef) {
if ps, ok := results[currentRef]; ok && ps.Status != nil {
took := ps.FinishedAt.Sub(ps.QueuedAt).Round(time.Millisecond)
printStatus(steps[i], *ps.Status, took, i, len(steps), steps[i].Label())
if i != -1 {
printStatus(steps[i], *ps.Status, took, i, len(steps), steps[i].Label())
}
}

i++
currentRef = steps[i].Ref
printStatusHeader(i, len(steps), steps[i].Label())
if i < len(steps) {
currentRef = steps[i].Ref
printStatusHeader(i, len(steps), steps[i].Label())
}
}
}

for _, step := range steps[i:] {
if ps, ok := results[currentRef]; ok && ps.Status != nil {
took := ps.FinishedAt.Sub(ps.QueuedAt).Round(time.Millisecond)
printStatus(step, *ps.Status, took, i, len(steps), steps[i].Label())
}
if i != -1 && i < len(steps) {
for _, step := range steps[i:] {
if ps, ok := results[currentRef]; ok && ps.Status != nil {
took := ps.FinishedAt.Sub(ps.QueuedAt).Round(time.Millisecond)
printStatus(step, *ps.Status, took, i, len(steps), steps[i].Label())
}

i++
currentRef = step.Ref
if i < len(steps) {
printStatusHeader(i, len(steps), steps[i].Label())
i++
currentRef = step.Ref
if i < len(steps) {
printStatusHeader(i, len(steps), steps[i].Label())
}
}
}
}

0 comments on commit ccd9e99

Please sign in to comment.