@@ -206,6 +206,7 @@ describe("runs", () => {
206
206
207
207
beforeEach ( ( ) => {
208
208
sandbox = sinon . createSandbox ( ) ;
209
+ getParallelsStub = sandbox . stub ( ) ;
209
210
setParallelsStub = sandbox . stub ( ) ;
210
211
warnSpecLimitStub = sandbox . stub ( ) ;
211
212
setUsernameStub = sandbox . stub ( ) ;
@@ -257,6 +258,7 @@ describe("runs", () => {
257
258
'../helpers/utils' : {
258
259
validateBstackJson : validateBstackJsonStub ,
259
260
sendUsageReport : sendUsageReportStub ,
261
+ getParallels : getParallelsStub ,
260
262
setParallels : setParallelsStub ,
261
263
warnSpecLimit : warnSpecLimitStub ,
262
264
setUsername : setUsernameStub ,
@@ -322,6 +324,7 @@ describe("runs", () => {
322
324
sinon . assert . calledOnce ( setLocalConfigFileStub ) ;
323
325
sinon . assert . calledOnce ( setCypressConfigFilenameStub ) ;
324
326
sinon . assert . calledOnce ( getNumberOfSpecFilesStub ) ;
327
+ sinon . assert . calledOnce ( getParallelsStub ) ;
325
328
sinon . assert . calledOnce ( setParallelsStub ) ;
326
329
sinon . assert . calledOnce ( warnSpecLimitStub ) ;
327
330
sinon . assert . calledOnce ( setLocalStub ) ;
@@ -356,6 +359,7 @@ describe("runs", () => {
356
359
beforeEach ( ( ) => {
357
360
sandbox = sinon . createSandbox ( ) ;
358
361
validateBstackJsonStub = sandbox . stub ( ) ;
362
+ getParallelsStub = sandbox . stub ( ) ;
359
363
setParallelsStub = sandbox . stub ( ) ;
360
364
warnSpecLimitStub = sandbox . stub ( ) ;
361
365
setUsernameStub = sandbox . stub ( ) ;
@@ -407,6 +411,7 @@ describe("runs", () => {
407
411
'../helpers/utils' : {
408
412
validateBstackJson : validateBstackJsonStub ,
409
413
sendUsageReport : sendUsageReportStub ,
414
+ getParallels : getParallelsStub ,
410
415
setParallels : setParallelsStub ,
411
416
warnSpecLimit : warnSpecLimitStub ,
412
417
setUsername : setUsernameStub ,
@@ -472,6 +477,7 @@ describe("runs", () => {
472
477
sinon . assert . calledOnce ( setLocalModeStub ) ;
473
478
sinon . assert . calledOnce ( setLocalConfigFileStub ) ;
474
479
sinon . assert . calledOnce ( getNumberOfSpecFilesStub ) ;
480
+ sinon . assert . calledOnce ( getParallelsStub ) ;
475
481
sinon . assert . calledOnce ( setParallelsStub ) ;
476
482
sinon . assert . calledOnce ( warnSpecLimitStub ) ;
477
483
sinon . assert . calledOnce ( setLocalStub ) ;
@@ -509,6 +515,7 @@ describe("runs", () => {
509
515
beforeEach ( ( ) => {
510
516
sandbox = sinon . createSandbox ( ) ;
511
517
validateBstackJsonStub = sandbox . stub ( ) ;
518
+ getParallelsStub = sandbox . stub ( ) ;
512
519
setParallelsStub = sandbox . stub ( ) ;
513
520
warnSpecLimitStub = sandbox . stub ( ) ;
514
521
setUsernameStub = sandbox . stub ( ) ;
@@ -562,6 +569,7 @@ describe("runs", () => {
562
569
'../helpers/utils' : {
563
570
validateBstackJson : validateBstackJsonStub ,
564
571
sendUsageReport : sendUsageReportStub ,
572
+ getParallels : getParallelsStub ,
565
573
setParallels : setParallelsStub ,
566
574
warnSpecLimit : warnSpecLimitStub ,
567
575
setUsername : setUsernameStub ,
@@ -638,6 +646,7 @@ describe("runs", () => {
638
646
sinon . assert . calledOnce ( validateBstackJsonStub ) ;
639
647
sinon . assert . calledOnce ( capabilityValidatorStub ) ;
640
648
sinon . assert . calledOnce ( getNumberOfSpecFilesStub ) ;
649
+ sinon . assert . calledOnce ( getParallelsStub ) ;
641
650
sinon . assert . calledOnce ( setParallelsStub ) ;
642
651
sinon . assert . calledOnce ( warnSpecLimitStub ) ;
643
652
sinon . assert . calledOnce ( setLocalStub ) ;
@@ -675,6 +684,7 @@ describe("runs", () => {
675
684
beforeEach ( ( ) => {
676
685
sandbox = sinon . createSandbox ( ) ;
677
686
validateBstackJsonStub = sandbox . stub ( ) ;
687
+ getParallelsStub = sandbox . stub ( ) ;
678
688
setParallelsStub = sandbox . stub ( ) ;
679
689
warnSpecLimitStub = sandbox . stub ( )
680
690
setUsernameStub = sandbox . stub ( ) ;
@@ -736,7 +746,7 @@ describe("runs", () => {
736
746
let errorCode = null ;
737
747
let message = `Success! ${ Constants . userMessages . BUILD_CREATED } with build id: random_build_id` ;
738
748
let dashboardLink = `${ Constants . userMessages . VISIT_DASHBOARD } ${ dashboardUrl } ` ;
739
- let data = { time_components : { } , unique_id : 'random_hash' , package_error : 'test' , checkmd5_error : 'test' , build_id : 'random_build_id' }
749
+ let data = { user_id : 1234 , parallels : 10 , time_components : { } , unique_id : 'random_hash' , package_error : 'test' , checkmd5_error : 'test' , build_id : 'random_build_id' }
740
750
741
751
const runs = proxyquire ( '../../../../bin/commands/runs' , {
742
752
'../helpers/utils' : {
@@ -750,6 +760,7 @@ describe("runs", () => {
750
760
setTestEnvs : setTestEnvsStub ,
751
761
setSystemEnvs : setSystemEnvsStub ,
752
762
setUsageReportingFlag : setUsageReportingFlagStub ,
763
+ getParallels : getParallelsStub ,
753
764
setParallels : setParallelsStub ,
754
765
warnSpecLimit : warnSpecLimitStub ,
755
766
getConfigPath : getConfigPathStub ,
@@ -821,7 +832,8 @@ describe("runs", () => {
821
832
stopLocalBinaryStub . returns ( Promise . resolve ( "nothing" ) ) ;
822
833
nonEmptyArrayStub . returns ( false ) ;
823
834
checkErrorStub . returns ( 'test' ) ;
824
- createBuildStub . returns ( Promise . resolve ( { message : 'Success' , build_id : 'random_build_id' , dashboard_url : dashboardUrl } ) ) ;
835
+ getParallelsStub . returns ( 10 ) ;
836
+ createBuildStub . returns ( Promise . resolve ( { message : 'Success' , build_id : 'random_build_id' , dashboard_url : dashboardUrl , user_id : 1234 } ) ) ;
825
837
826
838
return runs ( args )
827
839
. then ( function ( _bsConfig ) {
@@ -834,6 +846,7 @@ describe("runs", () => {
834
846
sinon . assert . calledOnce ( setLocalConfigFileStub ) ;
835
847
sinon . assert . calledOnce ( capabilityValidatorStub ) ;
836
848
sinon . assert . calledOnce ( getNumberOfSpecFilesStub ) ;
849
+ sinon . assert . calledOnce ( getParallelsStub ) ;
837
850
sinon . assert . calledOnce ( setParallelsStub ) ;
838
851
sinon . assert . calledOnce ( warnSpecLimitStub ) ;
839
852
sinon . assert . calledOnce ( setLocalStub ) ;
0 commit comments