Skip to content

Commit

Permalink
fix(core): task runner parallel should read from taskRunnerOptions (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder authored May 2, 2023
1 parent ccf6759 commit d084e67
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 25 deletions.
3 changes: 2 additions & 1 deletion packages/nx/src/tasks-runner/default-tasks-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export const defaultTasksRunner: TasksRunner<
} else if (
(options as any)['parallel'] === 'true' ||
(options as any)['parallel'] === true ||
(options as any)['parallel'] === undefined
(options as any)['parallel'] === undefined ||
(options as any)['parallel'] === ''
) {
(options as any)['parallel'] = Number((options as any)['maxParallel'] || 3);
}
Expand Down
22 changes: 0 additions & 22 deletions packages/nx/src/utils/command-line-utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ describe('splitArgs', () => {
base: 'sha1',
head: 'sha2',
skipNxCache: false,
parallel: 3,
});
});

Expand Down Expand Up @@ -52,7 +51,6 @@ describe('splitArgs', () => {
).toEqual({
base: 'main',
skipNxCache: false,
parallel: 3,
});
});

Expand All @@ -70,7 +68,6 @@ describe('splitArgs', () => {
).toEqual({
base: 'develop',
skipNxCache: false,
parallel: 3,
});
});

Expand All @@ -88,7 +85,6 @@ describe('splitArgs', () => {
).toEqual({
base: 'main',
skipNxCache: false,
parallel: 3,
});
});

Expand Down Expand Up @@ -178,7 +174,6 @@ describe('splitArgs', () => {
{} as any
).nxArgs
).toEqual({
parallel: 3,
projects: ['aaa', 'bbb'],
skipNxCache: false,
});
Expand All @@ -205,7 +200,6 @@ describe('splitArgs', () => {
base: 'envVarSha1',
head: 'envVarSha2',
skipNxCache: false,
parallel: 3,
});

expect(
Expand All @@ -223,7 +217,6 @@ describe('splitArgs', () => {
base: 'envVarSha1',
head: 'directlyOnCommandSha1',
skipNxCache: false,
parallel: 3,
});

expect(
Expand All @@ -241,7 +234,6 @@ describe('splitArgs', () => {
base: 'directlyOnCommandSha2',
head: 'envVarSha2',
skipNxCache: false,
parallel: 3,
});
}
);
Expand Down Expand Up @@ -388,20 +380,6 @@ describe('splitArgs', () => {
expect(parallel).toEqual(5);
});

it('should default to 3 when not specified', () => {
const parallel = splitArgsIntoNxArgsAndOverrides(
{
$0: '',
__overrides_unparsed__: [],
},
'affected',
{} as any,
{} as any
).nxArgs.parallel;

expect(parallel).toEqual(3);
});

it('should default to 3 when used with no value specified', () => {
const parallel = splitArgsIntoNxArgsAndOverrides(
{
Expand Down
3 changes: 1 addition & 2 deletions packages/nx/src/utils/command-line-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ export function splitArgsIntoNxArgsAndOverrides(
} else if (
args['parallel'] === 'true' ||
args['parallel'] === true ||
args['parallel'] === '' ||
args['parallel'] === undefined
args['parallel'] === ''
) {
nxArgs['parallel'] = Number(
nxArgs['maxParallel'] || nxArgs['max-parallel'] || 3
Expand Down

1 comment on commit d084e67

@vercel
Copy link

@vercel vercel bot commented on d084e67 May 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-nrwl.vercel.app
nx-five.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx.dev

Please sign in to comment.