@@ -28,6 +28,7 @@ describe("runs", () => {
28
28
} ) ;
29
29
getErrorCodeFromErrStub = sandbox . stub ( ) . returns ( "random-error-code" ) ;
30
30
deleteResultsStub = sandbox . stub ( ) ;
31
+ readBsConfigJSONStub = sandbox . stub ( ) . returns ( null ) ;
31
32
} ) ;
32
33
33
34
afterEach ( ( ) => {
@@ -47,7 +48,8 @@ describe("runs", () => {
47
48
sendUsageReport : sendUsageReportStub ,
48
49
setUsageReportingFlag : setUsageReportingFlagStub ,
49
50
getConfigPath : getConfigPathStub ,
50
- deleteResults : deleteResultsStub
51
+ deleteResults : deleteResultsStub ,
52
+ readBsConfigJSON : readBsConfigJSONStub
51
53
} ,
52
54
} ) ;
53
55
@@ -206,6 +208,7 @@ describe("runs", () => {
206
208
207
209
beforeEach ( ( ) => {
208
210
sandbox = sinon . createSandbox ( ) ;
211
+ getParallelsStub = sandbox . stub ( ) ;
209
212
setParallelsStub = sandbox . stub ( ) ;
210
213
warnSpecLimitStub = sandbox . stub ( ) ;
211
214
setUsernameStub = sandbox . stub ( ) ;
@@ -257,6 +260,7 @@ describe("runs", () => {
257
260
'../helpers/utils' : {
258
261
validateBstackJson : validateBstackJsonStub ,
259
262
sendUsageReport : sendUsageReportStub ,
263
+ getParallels : getParallelsStub ,
260
264
setParallels : setParallelsStub ,
261
265
warnSpecLimit : warnSpecLimitStub ,
262
266
setUsername : setUsernameStub ,
@@ -322,6 +326,7 @@ describe("runs", () => {
322
326
sinon . assert . calledOnce ( setLocalConfigFileStub ) ;
323
327
sinon . assert . calledOnce ( setCypressConfigFilenameStub ) ;
324
328
sinon . assert . calledOnce ( getNumberOfSpecFilesStub ) ;
329
+ sinon . assert . calledOnce ( getParallelsStub ) ;
325
330
sinon . assert . calledOnce ( setParallelsStub ) ;
326
331
sinon . assert . calledOnce ( warnSpecLimitStub ) ;
327
332
sinon . assert . calledOnce ( setLocalStub ) ;
@@ -356,6 +361,7 @@ describe("runs", () => {
356
361
beforeEach ( ( ) => {
357
362
sandbox = sinon . createSandbox ( ) ;
358
363
validateBstackJsonStub = sandbox . stub ( ) ;
364
+ getParallelsStub = sandbox . stub ( ) ;
359
365
setParallelsStub = sandbox . stub ( ) ;
360
366
warnSpecLimitStub = sandbox . stub ( ) ;
361
367
setUsernameStub = sandbox . stub ( ) ;
@@ -408,6 +414,7 @@ describe("runs", () => {
408
414
'../helpers/utils' : {
409
415
validateBstackJson : validateBstackJsonStub ,
410
416
sendUsageReport : sendUsageReportStub ,
417
+ getParallels : getParallelsStub ,
411
418
setParallels : setParallelsStub ,
412
419
warnSpecLimit : warnSpecLimitStub ,
413
420
setUsername : setUsernameStub ,
@@ -476,6 +483,7 @@ describe("runs", () => {
476
483
sinon . assert . calledOnce ( setLocalModeStub ) ;
477
484
sinon . assert . calledOnce ( setLocalConfigFileStub ) ;
478
485
sinon . assert . calledOnce ( getNumberOfSpecFilesStub ) ;
486
+ sinon . assert . calledOnce ( getParallelsStub ) ;
479
487
sinon . assert . calledOnce ( setParallelsStub ) ;
480
488
sinon . assert . calledOnce ( warnSpecLimitStub ) ;
481
489
sinon . assert . calledOnce ( setLocalStub ) ;
@@ -513,6 +521,7 @@ describe("runs", () => {
513
521
beforeEach ( ( ) => {
514
522
sandbox = sinon . createSandbox ( ) ;
515
523
validateBstackJsonStub = sandbox . stub ( ) ;
524
+ getParallelsStub = sandbox . stub ( ) ;
516
525
setParallelsStub = sandbox . stub ( ) ;
517
526
warnSpecLimitStub = sandbox . stub ( ) ;
518
527
setUsernameStub = sandbox . stub ( ) ;
@@ -567,6 +576,7 @@ describe("runs", () => {
567
576
'../helpers/utils' : {
568
577
validateBstackJson : validateBstackJsonStub ,
569
578
sendUsageReport : sendUsageReportStub ,
579
+ getParallels : getParallelsStub ,
570
580
setParallels : setParallelsStub ,
571
581
warnSpecLimit : warnSpecLimitStub ,
572
582
setUsername : setUsernameStub ,
@@ -646,6 +656,7 @@ describe("runs", () => {
646
656
sinon . assert . calledOnce ( validateBstackJsonStub ) ;
647
657
sinon . assert . calledOnce ( capabilityValidatorStub ) ;
648
658
sinon . assert . calledOnce ( getNumberOfSpecFilesStub ) ;
659
+ sinon . assert . calledOnce ( getParallelsStub ) ;
649
660
sinon . assert . calledOnce ( setParallelsStub ) ;
650
661
sinon . assert . calledOnce ( warnSpecLimitStub ) ;
651
662
sinon . assert . calledOnce ( setLocalStub ) ;
@@ -683,6 +694,7 @@ describe("runs", () => {
683
694
beforeEach ( ( ) => {
684
695
sandbox = sinon . createSandbox ( ) ;
685
696
validateBstackJsonStub = sandbox . stub ( ) ;
697
+ getParallelsStub = sandbox . stub ( ) ;
686
698
setParallelsStub = sandbox . stub ( ) ;
687
699
warnSpecLimitStub = sandbox . stub ( )
688
700
setUsernameStub = sandbox . stub ( ) ;
@@ -748,7 +760,7 @@ describe("runs", () => {
748
760
let errorCode = null ;
749
761
let message = `Success! ${ Constants . userMessages . BUILD_CREATED } with build id: random_build_id` ;
750
762
let dashboardLink = `${ Constants . userMessages . VISIT_DASHBOARD } ${ dashboardUrl } ` ;
751
- let data = { time_components : { } , unique_id : 'random_hash' , package_error : 'test' , checkmd5_error : 'test' , build_id : 'random_build_id' , test_zip_size : 123 , npm_zip_size : 123 }
763
+ let data = { user_id : 1234 , parallels : 10 , time_components : { } , unique_id : 'random_hash' , package_error : 'test' , checkmd5_error : 'test' , build_id : 'random_build_id' , test_zip_size : 123 , npm_zip_size : 123 }
752
764
753
765
const runs = proxyquire ( '../../../../bin/commands/runs' , {
754
766
'../helpers/utils' : {
@@ -762,6 +774,7 @@ describe("runs", () => {
762
774
setTestEnvs : setTestEnvsStub ,
763
775
setSystemEnvs : setSystemEnvsStub ,
764
776
setUsageReportingFlag : setUsageReportingFlagStub ,
777
+ getParallels : getParallelsStub ,
765
778
setParallels : setParallelsStub ,
766
779
warnSpecLimit : warnSpecLimitStub ,
767
780
getConfigPath : getConfigPathStub ,
@@ -837,8 +850,9 @@ describe("runs", () => {
837
850
stopLocalBinaryStub . returns ( Promise . resolve ( "nothing" ) ) ;
838
851
nonEmptyArrayStub . returns ( false ) ;
839
852
checkErrorStub . returns ( 'test' ) ;
853
+ getParallelsStub . returns ( 10 ) ;
854
+ createBuildStub . returns ( Promise . resolve ( { message : 'Success' , build_id : 'random_build_id' , dashboard_url : dashboardUrl , user_id : 1234 } ) ) ;
840
855
fetchZipSizeStub . returns ( 123 ) ;
841
- createBuildStub . returns ( Promise . resolve ( { message : 'Success' , build_id : 'random_build_id' , dashboard_url : dashboardUrl } ) ) ;
842
856
843
857
return runs ( args )
844
858
. then ( function ( _bsConfig ) {
@@ -851,6 +865,7 @@ describe("runs", () => {
851
865
sinon . assert . calledOnce ( setLocalConfigFileStub ) ;
852
866
sinon . assert . calledOnce ( capabilityValidatorStub ) ;
853
867
sinon . assert . calledOnce ( getNumberOfSpecFilesStub ) ;
868
+ sinon . assert . calledOnce ( getParallelsStub ) ;
854
869
sinon . assert . calledOnce ( setParallelsStub ) ;
855
870
sinon . assert . calledOnce ( warnSpecLimitStub ) ;
856
871
sinon . assert . calledTwice ( fetchZipSizeStub ) ;
0 commit comments