@@ -50,10 +50,10 @@ type UploadResponse struct {
5050
5151// Result ...
5252type Result struct {
53- Name string
54- XMLContent []byte
55- ImagePaths []string
56- StepInfo models.TestResultStepInfo
53+ Name string
54+ XMLContent []byte
55+ AttachmentPaths []string
56+ StepInfo models.TestResultStepInfo
5757}
5858
5959// Results ...
@@ -95,7 +95,7 @@ func httpCall(apiToken, method, url string, input io.Reader, output interface{},
9595 return nil
9696}
9797
98- func findImages (testDir string ) (imageFilePaths []string ) {
98+ func findSupportedAttachments (testDir string ) (imageFilePaths []string ) {
9999 for _ , ext := range testasset .AssetTypes {
100100 if paths , err := filepath .Glob (filepath .Join (testDir , "*" + ext )); err == nil {
101101 imageFilePaths = append (imageFilePaths , paths ... )
@@ -227,15 +227,15 @@ func ParseTestResults(testsRootDir string, useLegacyXCResultExtractionMethod boo
227227 xmlData = append ([]byte (`<?xml version="1.0" encoding="UTF-8"?>` + "\n " ), xmlData ... )
228228
229229 // so here I will have image paths, xml data, and step info per test dir in a bundle info
230- images := findImages (testPhaseDirPath )
230+ attachments := findSupportedAttachments (testPhaseDirPath )
231231
232- logger .Debugf ("found images : %d" , len (images ))
232+ logger .Debugf ("found attachments : %d" , len (attachments ))
233233
234234 results = append (results , Result {
235- Name : testInfo .Name ,
236- XMLContent : xmlData ,
237- ImagePaths : images ,
238- StepInfo : * stepInfo ,
235+ Name : testInfo .Name ,
236+ XMLContent : xmlData ,
237+ AttachmentPaths : attachments ,
238+ StepInfo : * stepInfo ,
239239 })
240240 }
241241 }
@@ -257,7 +257,7 @@ func (results Results) Upload(apiToken, endpointBaseURL, appSlug, buildSlug stri
257257 Name : result .Name ,
258258 Step : result .StepInfo ,
259259 }
260- for _ , asset := range result .ImagePaths {
260+ for _ , asset := range result .AttachmentPaths {
261261 fi , err := os .Stat (asset )
262262 if err != nil {
263263 return fmt .Errorf ("failed to get file info for %s: %w" , asset , err )
@@ -286,7 +286,7 @@ func (results Results) Upload(apiToken, endpointBaseURL, appSlug, buildSlug stri
286286 }
287287
288288 for _ , upload := range uploadResponse .Assets {
289- for _ , file := range result .ImagePaths {
289+ for _ , file := range result .AttachmentPaths {
290290 if filepath .Base (file ) == upload .FileName {
291291 fi , err := os .Open (file )
292292 if err != nil {
0 commit comments