diff --git a/docs/nx-cloud/features/split-e2e-tasks.md b/docs/nx-cloud/features/split-e2e-tasks.md index 487bb2dcd1d31..d85c00933949a 100644 --- a/docs/nx-cloud/features/split-e2e-tasks.md +++ b/docs/nx-cloud/features/split-e2e-tasks.md @@ -34,13 +34,6 @@ nx add @nx/playwright nx add @nx/jest ``` -{% /tab %} -{% tab label="Gradle" %} - -```shell {% skipRescope=true %} -nx add @nx/gradle -``` - {% /tab %} {% /tabs %} diff --git a/packages/nx/src/tasks-runner/task-graph-utils.spec.ts b/packages/nx/src/tasks-runner/task-graph-utils.spec.ts index ac5ef4e3b44b2..182ed5d1a5442 100644 --- a/packages/nx/src/tasks-runner/task-graph-utils.spec.ts +++ b/packages/nx/src/tasks-runner/task-graph-utils.spec.ts @@ -98,6 +98,7 @@ describe('task graph utils', () => { const taskGraph = { tasks: { 'e2e:e2e': { + id: 'e2e:e2e', target: { project: 'e2e', target: 'e2e', @@ -124,6 +125,7 @@ describe('task graph utils', () => { const taskGraph = { tasks: { 'e2e:e2e-ci': { + id: 'e2e:e2e-ci', target: { project: 'e2e', target: 'e2e-ci', @@ -153,12 +155,14 @@ describe('task graph utils', () => { const taskGraph = { tasks: { 'e2e:e2e-ci': { + id: 'e2e:e2e-ci', target: { project: 'e2e', target: 'e2e-ci', }, }, 'gradle:test-ci': { + id: 'gradle:test-ci', target: { project: 'gradle', target: 'test-ci', diff --git a/packages/nx/src/tasks-runner/task-orchestrator.ts b/packages/nx/src/tasks-runner/task-orchestrator.ts index f71771e71e2bb..cb9cb73e33324 100644 --- a/packages/nx/src/tasks-runner/task-orchestrator.ts +++ b/packages/nx/src/tasks-runner/task-orchestrator.ts @@ -1,27 +1,13 @@ import { defaultMaxListeners } from 'events'; -import { writeFileSync } from 'fs'; -import { relative } from 'path'; import { performance } from 'perf_hooks'; -import { ProjectGraph } from '../config/project-graph'; -import { Task, TaskGraph } from '../config/task-graph'; -import { DaemonClient } from '../daemon/client/client'; -import runCommandsImpl from '../executors/run-commands/run-commands.impl'; -import { hashTask } from '../hasher/hash-task'; +import { relative } from 'path'; +import { writeFileSync } from 'fs'; import { TaskHasher } from '../hasher/task-hasher'; -import { output } from '../utils/output'; -import { combineOptionsForExecutor } from '../utils/params'; -import { workspaceRoot } from '../utils/workspace-root'; +import runCommandsImpl from '../executors/run-commands/run-commands.impl'; +import { ForkedProcessTaskRunner } from './forked-process-task-runner'; import { Cache } from './cache'; import { DefaultTasksRunnerOptions } from './default-tasks-runner'; -import { ForkedProcessTaskRunner } from './forked-process-task-runner'; -import { TaskMetadata } from './life-cycle'; -import { - getEnvVariablesForBatchProcess, - getEnvVariablesForTask, - getTaskSpecificEnv, -} from './task-env'; import { TaskStatus } from './tasks-runner'; -import { Batch, TasksSchedule } from './tasks-schedule'; import { calculateReverseDeps, getExecutorForTask, @@ -31,6 +17,20 @@ import { removeTasksFromTaskGraph, shouldStreamOutput, } from './utils'; +import { Batch, TasksSchedule } from './tasks-schedule'; +import { TaskMetadata } from './life-cycle'; +import { ProjectGraph } from '../config/project-graph'; +import { Task, TaskGraph } from '../config/task-graph'; +import { DaemonClient } from '../daemon/client/client'; +import { hashTask } from '../hasher/hash-task'; +import { + getEnvVariablesForBatchProcess, + getEnvVariablesForTask, + getTaskSpecificEnv, +} from './task-env'; +import { workspaceRoot } from '../utils/workspace-root'; +import { output } from '../utils/output'; +import { combineOptionsForExecutor } from '../utils/params'; export class TaskOrchestrator { private cache = new Cache(this.options); @@ -388,15 +388,7 @@ export class TaskOrchestrator { task, this.projectGraph ); - - if (targetConfiguration.executor === 'nx:noop') { - writeFileSync(temporaryOutputPath, ''); - results.push({ - task, - status: 'success', - terminalOutput: '', - }); - } else if ( + if ( process.env.NX_RUN_COMMANDS_DIRECTLY !== 'false' && targetConfiguration.executor === 'nx:run-commands' && !shouldPrefix @@ -464,6 +456,13 @@ export class TaskOrchestrator { terminalOutput, }); } + } else if (targetConfiguration.executor === 'nx:noop') { + writeFileSync(temporaryOutputPath, ''); + results.push({ + task, + status: 'success', + terminalOutput: '', + }); } else { // cache prep const { code, terminalOutput } = await this.runTaskInForkedProcess(