Skip to content

Commit

Permalink
fix: ensure screenshots are recognized artifacts (#994)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexplischke authored Dec 13, 2024
1 parent aa7c66c commit 8685650
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions internal/http/resto.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"
"io"
"net/http"
"reflect"
"sort"
"strings"
"time"
Expand Down Expand Up @@ -189,12 +188,25 @@ func (c *Resto) ArtifactNames(ctx context.Context, jobID string, realDevice bool

var filesList []string
for k, v := range filesMap {
if k == "video" || k == "screenshots" {
if v == nil || k == "video" {
continue
}

if v != nil && reflect.TypeOf(v).Name() == "string" {
filesList = append(filesList, v.(string))
if val, ok := v.(string); ok {
filesList = append(filesList, val)
continue
}

if k == "screenshots" {
screenshots, ok := v.([]interface{})
if !ok {
continue
}
for _, s := range screenshots {
if screenshot, ok := s.(string); ok {
filesList = append(filesList, screenshot)
}
}
}
}
return filesList, nil
Expand Down

0 comments on commit 8685650

Please sign in to comment.