Skip to content

Commit

Permalink
fix(core): review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKless committed Jul 23, 2024
1 parent fe80faf commit d6a791a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 34 deletions.
7 changes: 0 additions & 7 deletions docs/nx-cloud/features/split-e2e-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

Expand Down
4 changes: 4 additions & 0 deletions packages/nx/src/tasks-runner/task-graph-utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ describe('task graph utils', () => {
const taskGraph = {
tasks: {
'e2e:e2e': {
id: 'e2e:e2e',
target: {
project: 'e2e',
target: 'e2e',
Expand All @@ -124,6 +125,7 @@ describe('task graph utils', () => {
const taskGraph = {
tasks: {
'e2e:e2e-ci': {
id: 'e2e:e2e-ci',
target: {
project: 'e2e',
target: 'e2e-ci',
Expand Down Expand Up @@ -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',
Expand Down
53 changes: 26 additions & 27 deletions packages/nx/src/tasks-runner/task-orchestrator.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit d6a791a

Please sign in to comment.