@@ -70,36 +70,31 @@ export const deployGraph = async (config: Config, workspace: string, testSuiteId
7070 const parallelGroup = level . filter ( c => c . parallel === true )
7171 const sequentialGroup = level . filter ( c => c . parallel !== true )
7272
73- // Fire both groups concurrently; await both before moving to the next level.
74- const parallelChain = parallelGroup . length > 0
75- ? ( async ( ) => {
76- logger . info ( "" )
77- logger . info ( "Deploying %d component(s) in parallel for suite \"%s\": %s" , parallelGroup . length , testSuiteId , parallelGroup . map ( c => c . id ) . join ( ", " ) )
78- const results = await Promise . all (
79- parallelGroup . map ( async componentSpec => {
80- const idx = ++ componentIndex
81- logger . info ( "Deploying graph component (%s of %s) \"%s\" for suite \"%s\"..." , idx , sortedComponents . length , componentSpec . name , testSuiteId )
82- const commitSha = await Deployer . deployComponent ( config , workspace , componentSpec , namespace )
83- logger . info ( "Graph component \"%s\" for suite \"%s\" deployed." , componentSpec . name , testSuiteId )
84- return new DeployedComponent ( commitSha , componentSpec )
85- } )
86- )
87- deployments . push ( ...results )
88- } ) ( )
89- : Promise . resolve ( )
90-
91- const sequentialChain = ( async ( ) => {
92- for ( const componentSpec of sequentialGroup ) {
93- const idx = ++ componentIndex
94- logger . info ( "" )
95- logger . info ( "Deploying graph component (%s of %s) \"%s\" for suite \"%s\"..." , idx , sortedComponents . length , componentSpec . name , testSuiteId )
96- logger . info ( "" )
97- const commitSha = await Deployer . deployComponent ( config , workspace , componentSpec , namespace )
98- deployments . push ( new DeployedComponent ( commitSha , componentSpec ) )
99- }
100- } ) ( )
101-
102- await Promise . all ( [ parallelChain , sequentialChain ] )
73+ // First, deploy parallel-flagged components concurrently.
74+ // Then, once all parallel components at this level are done, deploy sequential ones in order.
75+ if ( parallelGroup . length > 0 ) {
76+ logger . info ( "" )
77+ logger . info ( "Deploying %d component(s) in parallel for suite \"%s\": %s" , parallelGroup . length , testSuiteId , parallelGroup . map ( c => c . id ) . join ( ", " ) )
78+ const results = await Promise . all (
79+ parallelGroup . map ( async componentSpec => {
80+ const idx = ++ componentIndex
81+ logger . info ( "Deploying graph component (%s of %s) \"%s\" for suite \"%s\"..." , idx , sortedComponents . length , componentSpec . name , testSuiteId )
82+ const commitSha = await Deployer . deployComponent ( config , workspace , componentSpec , namespace )
83+ logger . info ( "Graph component \"%s\" for suite \"%s\" deployed." , componentSpec . name , testSuiteId )
84+ return new DeployedComponent ( commitSha , componentSpec )
85+ } )
86+ )
87+ deployments . push ( ...results )
88+ }
89+
90+ for ( const componentSpec of sequentialGroup ) {
91+ const idx = ++ componentIndex
92+ logger . info ( "" )
93+ logger . info ( "Deploying graph component (%s of %s) \"%s\" for suite \"%s\"..." , idx , sortedComponents . length , componentSpec . name , testSuiteId )
94+ logger . info ( "" )
95+ const commitSha = await Deployer . deployComponent ( config , workspace , componentSpec , namespace )
96+ deployments . push ( new DeployedComponent ( commitSha , componentSpec ) )
97+ }
10398 }
10499 } ) ( )
105100
0 commit comments