File tree Expand file tree Collapse file tree 4 files changed +14
-16
lines changed
packages/ci/src/lib/monorepo/handlers Expand file tree Collapse file tree 4 files changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,6 @@ import type { MonorepoToolHandler } from '../tools.js';
1111
1212const WORKSPACE_FILE = 'pnpm-workspace.yaml' ;
1313
14- // https://pnpm.io/cli/recursive#--workspace-concurrency
15- const DEFAULT_WORKSPACE_CONCURRENCY = 4 ;
16-
1714export const pnpmHandler : MonorepoToolHandler = {
1815 tool : 'pnpm' ,
1916
@@ -46,16 +43,19 @@ export const pnpmHandler: MonorepoToolHandler = {
4643 } ,
4744
4845 createRunManyCommand ( options , projects ) {
49- const workspaceConcurrency : number =
46+ // https://pnpm.io/cli/recursive#--workspace-concurrency
47+ const workspaceConcurrency : number | null =
5048 options . parallel === true
51- ? DEFAULT_WORKSPACE_CONCURRENCY
49+ ? null
5250 : options . parallel === false
5351 ? 1
5452 : options . parallel ;
5553 return [
5654 'pnpm' ,
5755 '--recursive' ,
58- `--workspace-concurrency=${ workspaceConcurrency } ` ,
56+ ...( workspaceConcurrency == null
57+ ? [ ]
58+ : [ `--workspace-concurrency=${ workspaceConcurrency } ` ] ) ,
5959 ...( projects . only ?. map ( project => `--filter=${ project } ` ) ?? [ ] ) ,
6060 options . task ,
6161 ] . join ( ' ' ) ;
Original file line number Diff line number Diff line change @@ -198,13 +198,13 @@ describe('pnpmHandler', () => {
198198 ) ;
199199 } ) ;
200200
201- it ( 'should set parallel flag with default number of jobs ' , ( ) => {
201+ it ( 'should leave default concurrency if parallel flag is true ' , ( ) => {
202202 expect (
203203 pnpmHandler . createRunManyCommand (
204204 { ...options , parallel : true } ,
205205 projects ,
206206 ) ,
207- ) . toBe ( 'pnpm --recursive --workspace-concurrency=4 code-pushup' ) ;
207+ ) . toBe ( 'pnpm --recursive code-pushup' ) ;
208208 } ) ;
209209
210210 it ( 'should set parallel flag with custom number of jobs' , ( ) => {
Original file line number Diff line number Diff line change @@ -7,9 +7,6 @@ import { yarnHandler } from './yarn.js';
77
88const WORKSPACE_HANDLERS = [ pnpmHandler , yarnHandler , npmHandler ] ;
99
10- // https://turbo.build/repo/docs/reference/run#--concurrency-number--percentage
11- const DEFAULT_CONCURRENCY = 10 ;
12-
1310type TurboConfig = {
1411 tasks : Record < string , object > ;
1512} ;
@@ -47,9 +44,10 @@ export const turboHandler: MonorepoToolHandler = {
4744 } ,
4845
4946 createRunManyCommand ( options , projects ) {
50- const concurrency : number =
47+ // https://turbo.build/repo/docs/reference/run#--concurrency-number--percentage
48+ const concurrency : number | null =
5149 options . parallel === true
52- ? DEFAULT_CONCURRENCY
50+ ? null
5351 : options . parallel === false
5452 ? 1
5553 : options . parallel ;
@@ -59,7 +57,7 @@ export const turboHandler: MonorepoToolHandler = {
5957 'run' ,
6058 options . task ,
6159 ...( projects . only ?. map ( project => `--filter=${ project } ` ) ?? [ ] ) ,
62- `--concurrency=${ concurrency } ` ,
60+ ... ( concurrency == null ? [ ] : [ `--concurrency=${ concurrency } ` ] ) ,
6361 '--' ,
6462 ] . join ( ' ' ) ;
6563 } ,
Original file line number Diff line number Diff line change @@ -191,13 +191,13 @@ describe('turboHandler', () => {
191191 ) ;
192192 } ) ;
193193
194- it ( 'should set parallel flag with default number of jobs ' , ( ) => {
194+ it ( 'should leave default concurrency if parallel flag is true ' , ( ) => {
195195 expect (
196196 turboHandler . createRunManyCommand (
197197 { ...options , parallel : true } ,
198198 projects ,
199199 ) ,
200- ) . toBe ( 'npx turbo run code-pushup --concurrency=10 -- ' ) ;
200+ ) . toBe ( 'npx turbo run code-pushup --' ) ;
201201 } ) ;
202202
203203 it ( 'should set parallel flag with custom number of jobs' , ( ) => {
You can’t perform that action at this time.
0 commit comments