@@ -135,6 +135,11 @@ const espressoCommand = program
135135 '--report-output-dir <path>' ,
136136 'Directory to save test reports (required when --report is used).' ,
137137 )
138+ // CI/CD metadata
139+ . option ( '--commit-sha <sha>' , 'The commit SHA of this upload.' )
140+ . option ( '--pull-request-id <id>' , 'The ID of the pull request this upload originated from.' )
141+ . option ( '--repo-name <name>' , 'Repository name (e.g., GitHub repo slug).' )
142+ . option ( '--repo-owner <owner>' , 'Repository owner (e.g., GitHub organization or user slug).' )
138143 // Authentication
139144 . option ( '--api-key <key>' , 'TestingBot API key.' )
140145 . option ( '--api-secret <secret>' , 'TestingBot API secret.' )
@@ -149,6 +154,16 @@ const espressoCommand = program
149154 return ;
150155 }
151156
157+ const metadata =
158+ args . commitSha || args . pullRequestId || args . repoName || args . repoOwner
159+ ? {
160+ commitSha : args . commitSha ,
161+ pullRequestId : args . pullRequestId ,
162+ repoName : args . repoName ,
163+ repoOwner : args . repoOwner ,
164+ }
165+ : undefined ;
166+
152167 const options = new EspressoOptions ( app , testApp , args . device , {
153168 version : args . platformVersion ,
154169 realDevice : args . realDevice ,
@@ -173,6 +188,7 @@ const espressoCommand = program
173188 async : args . async ,
174189 report : args . report ,
175190 reportOutputDir : args . reportOutputDir ,
191+ metadata,
176192 } ) ;
177193 const credentials = await Auth . getCredentials ( {
178194 apiKey : args . apiKey ,
@@ -315,6 +331,11 @@ const maestroCommand = program
315331 'Number of chunks to split flows into (by default each flow runs on its own session).' ,
316332 ( val ) => parseInt ( val , 10 ) ,
317333 )
334+ // CI/CD metadata
335+ . option ( '--commit-sha <sha>' , 'The commit SHA of this upload.' )
336+ . option ( '--pull-request-id <id>' , 'The ID of the pull request this upload originated from.' )
337+ . option ( '--repo-name <name>' , 'Repository name (e.g., GitHub repo slug).' )
338+ . option ( '--repo-owner <owner>' , 'Repository owner (e.g., GitHub organization or user slug).' )
318339 // Authentication
319340 . option ( '--api-key <key>' , 'TestingBot API key.' )
320341 . option ( '--api-secret <secret>' , 'TestingBot API secret.' )
@@ -351,6 +372,16 @@ const maestroCommand = program
351372 }
352373 }
353374
375+ const metadata =
376+ args . commitSha || args . pullRequestId || args . repoName || args . repoOwner
377+ ? {
378+ commitSha : args . commitSha ,
379+ pullRequestId : args . pullRequestId ,
380+ repoName : args . repoName ,
381+ repoOwner : args . repoOwner ,
382+ }
383+ : undefined ;
384+
354385 const options = new MaestroOptions ( app , flows , args . device , {
355386 includeTags : args . includeTags ,
356387 excludeTags : args . excludeTags ,
@@ -376,6 +407,7 @@ const maestroCommand = program
376407 artifactsOutputDir : args . artifactsOutputDir ,
377408 ignoreChecksumCheck : args . ignoreChecksumCheck ,
378409 shardSplit : args . shardSplit ,
410+ metadata,
379411 } ) ;
380412 const credentials = await Auth . getCredentials ( {
381413 apiKey : args . apiKey ,
@@ -466,6 +498,11 @@ const xcuitestCommand = program
466498 '--report-output-dir <path>' ,
467499 'Directory to save test reports (required when --report is used).' ,
468500 )
501+ // CI/CD metadata
502+ . option ( '--commit-sha <sha>' , 'The commit SHA of this upload.' )
503+ . option ( '--pull-request-id <id>' , 'The ID of the pull request this upload originated from.' )
504+ . option ( '--repo-name <name>' , 'Repository name (e.g., GitHub repo slug).' )
505+ . option ( '--repo-owner <owner>' , 'Repository owner (e.g., GitHub organization or user slug).' )
469506 // Authentication
470507 . option ( '--api-key <key>' , 'TestingBot API key.' )
471508 . option ( '--api-secret <secret>' , 'TestingBot API secret.' )
@@ -480,6 +517,16 @@ const xcuitestCommand = program
480517 return ;
481518 }
482519
520+ const metadata =
521+ args . commitSha || args . pullRequestId || args . repoName || args . repoOwner
522+ ? {
523+ commitSha : args . commitSha ,
524+ pullRequestId : args . pullRequestId ,
525+ repoName : args . repoName ,
526+ repoOwner : args . repoOwner ,
527+ }
528+ : undefined ;
529+
483530 const options = new XCUITestOptions ( app , testApp , args . device , {
484531 version : args . platformVersion ,
485532 realDevice : args . realDevice ,
@@ -497,6 +544,7 @@ const xcuitestCommand = program
497544 async : args . async ,
498545 report : args . report ,
499546 reportOutputDir : args . reportOutputDir ,
547+ metadata,
500548 } ) ;
501549 const credentials = await Auth . getCredentials ( {
502550 apiKey : args . apiKey ,
0 commit comments