@@ -206,6 +206,7 @@ describe("runs", () => {
206206
207207 beforeEach ( ( ) => {
208208 sandbox = sinon . createSandbox ( ) ;
209+ getParallelsStub = sandbox . stub ( ) ;
209210 setParallelsStub = sandbox . stub ( ) ;
210211 warnSpecLimitStub = sandbox . stub ( ) ;
211212 setUsernameStub = sandbox . stub ( ) ;
@@ -257,6 +258,7 @@ describe("runs", () => {
257258 '../helpers/utils' : {
258259 validateBstackJson : validateBstackJsonStub ,
259260 sendUsageReport : sendUsageReportStub ,
261+ getParallels : getParallelsStub ,
260262 setParallels : setParallelsStub ,
261263 warnSpecLimit : warnSpecLimitStub ,
262264 setUsername : setUsernameStub ,
@@ -322,6 +324,7 @@ describe("runs", () => {
322324 sinon . assert . calledOnce ( setLocalConfigFileStub ) ;
323325 sinon . assert . calledOnce ( setCypressConfigFilenameStub ) ;
324326 sinon . assert . calledOnce ( getNumberOfSpecFilesStub ) ;
327+ sinon . assert . calledOnce ( getParallelsStub ) ;
325328 sinon . assert . calledOnce ( setParallelsStub ) ;
326329 sinon . assert . calledOnce ( warnSpecLimitStub ) ;
327330 sinon . assert . calledOnce ( setLocalStub ) ;
@@ -356,6 +359,7 @@ describe("runs", () => {
356359 beforeEach ( ( ) => {
357360 sandbox = sinon . createSandbox ( ) ;
358361 validateBstackJsonStub = sandbox . stub ( ) ;
362+ getParallelsStub = sandbox . stub ( ) ;
359363 setParallelsStub = sandbox . stub ( ) ;
360364 warnSpecLimitStub = sandbox . stub ( ) ;
361365 setUsernameStub = sandbox . stub ( ) ;
@@ -407,6 +411,7 @@ describe("runs", () => {
407411 '../helpers/utils' : {
408412 validateBstackJson : validateBstackJsonStub ,
409413 sendUsageReport : sendUsageReportStub ,
414+ getParallels : getParallelsStub ,
410415 setParallels : setParallelsStub ,
411416 warnSpecLimit : warnSpecLimitStub ,
412417 setUsername : setUsernameStub ,
@@ -472,6 +477,7 @@ describe("runs", () => {
472477 sinon . assert . calledOnce ( setLocalModeStub ) ;
473478 sinon . assert . calledOnce ( setLocalConfigFileStub ) ;
474479 sinon . assert . calledOnce ( getNumberOfSpecFilesStub ) ;
480+ sinon . assert . calledOnce ( getParallelsStub ) ;
475481 sinon . assert . calledOnce ( setParallelsStub ) ;
476482 sinon . assert . calledOnce ( warnSpecLimitStub ) ;
477483 sinon . assert . calledOnce ( setLocalStub ) ;
@@ -509,6 +515,7 @@ describe("runs", () => {
509515 beforeEach ( ( ) => {
510516 sandbox = sinon . createSandbox ( ) ;
511517 validateBstackJsonStub = sandbox . stub ( ) ;
518+ getParallelsStub = sandbox . stub ( ) ;
512519 setParallelsStub = sandbox . stub ( ) ;
513520 warnSpecLimitStub = sandbox . stub ( ) ;
514521 setUsernameStub = sandbox . stub ( ) ;
@@ -562,6 +569,7 @@ describe("runs", () => {
562569 '../helpers/utils' : {
563570 validateBstackJson : validateBstackJsonStub ,
564571 sendUsageReport : sendUsageReportStub ,
572+ getParallels : getParallelsStub ,
565573 setParallels : setParallelsStub ,
566574 warnSpecLimit : warnSpecLimitStub ,
567575 setUsername : setUsernameStub ,
@@ -638,6 +646,7 @@ describe("runs", () => {
638646 sinon . assert . calledOnce ( validateBstackJsonStub ) ;
639647 sinon . assert . calledOnce ( capabilityValidatorStub ) ;
640648 sinon . assert . calledOnce ( getNumberOfSpecFilesStub ) ;
649+ sinon . assert . calledOnce ( getParallelsStub ) ;
641650 sinon . assert . calledOnce ( setParallelsStub ) ;
642651 sinon . assert . calledOnce ( warnSpecLimitStub ) ;
643652 sinon . assert . calledOnce ( setLocalStub ) ;
@@ -675,6 +684,7 @@ describe("runs", () => {
675684 beforeEach ( ( ) => {
676685 sandbox = sinon . createSandbox ( ) ;
677686 validateBstackJsonStub = sandbox . stub ( ) ;
687+ getParallelsStub = sandbox . stub ( ) ;
678688 setParallelsStub = sandbox . stub ( ) ;
679689 warnSpecLimitStub = sandbox . stub ( )
680690 setUsernameStub = sandbox . stub ( ) ;
@@ -736,7 +746,7 @@ describe("runs", () => {
736746 let errorCode = null ;
737747 let message = `Success! ${ Constants . userMessages . BUILD_CREATED } with build id: random_build_id` ;
738748 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' }
740750
741751 const runs = proxyquire ( '../../../../bin/commands/runs' , {
742752 '../helpers/utils' : {
@@ -750,6 +760,7 @@ describe("runs", () => {
750760 setTestEnvs : setTestEnvsStub ,
751761 setSystemEnvs : setSystemEnvsStub ,
752762 setUsageReportingFlag : setUsageReportingFlagStub ,
763+ getParallels : getParallelsStub ,
753764 setParallels : setParallelsStub ,
754765 warnSpecLimit : warnSpecLimitStub ,
755766 getConfigPath : getConfigPathStub ,
@@ -821,7 +832,8 @@ describe("runs", () => {
821832 stopLocalBinaryStub . returns ( Promise . resolve ( "nothing" ) ) ;
822833 nonEmptyArrayStub . returns ( false ) ;
823834 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 } ) ) ;
825837
826838 return runs ( args )
827839 . then ( function ( _bsConfig ) {
@@ -834,6 +846,7 @@ describe("runs", () => {
834846 sinon . assert . calledOnce ( setLocalConfigFileStub ) ;
835847 sinon . assert . calledOnce ( capabilityValidatorStub ) ;
836848 sinon . assert . calledOnce ( getNumberOfSpecFilesStub ) ;
849+ sinon . assert . calledOnce ( getParallelsStub ) ;
837850 sinon . assert . calledOnce ( setParallelsStub ) ;
838851 sinon . assert . calledOnce ( warnSpecLimitStub ) ;
839852 sinon . assert . calledOnce ( setLocalStub ) ;
0 commit comments