From d378f2c4497284447facc764a27c2ee996452e0b Mon Sep 17 00:00:00 2001 From: Isaac Mann Date: Fri, 16 Aug 2024 10:53:56 -0400 Subject: [PATCH] docs(core): plugin atomizer set up (#27478) Update plugin overview pages to describe atomizer set up --- .../packages/cypress/documents/overview.md | 2 +- .../packages/gradle/documents/overview.md | 20 ++++++++++++++++++- .../packages/jest/documents/overview.md | 2 +- .../packages/playwright/documents/overview.md | 18 +++++++++++++++++ docs/nx-cloud/features/split-e2e-tasks.md | 2 +- .../shared/packages/cypress/cypress-plugin.md | 2 +- docs/shared/packages/gradle/gradle-plugin.md | 20 ++++++++++++++++++- docs/shared/packages/jest/jest-plugin.md | 2 +- .../packages/playwright/playwright-plugin.md | 18 +++++++++++++++++ 9 files changed, 79 insertions(+), 7 deletions(-) diff --git a/docs/generated/packages/cypress/documents/overview.md b/docs/generated/packages/cypress/documents/overview.md index 0fda193d83..74bafa3d07 100644 --- a/docs/generated/packages/cypress/documents/overview.md +++ b/docs/generated/packages/cypress/documents/overview.md @@ -86,7 +86,7 @@ The `targetName`, `ciTargetName`, `componentTestingTargetName`, and `open-cypres ### Splitting E2E tasks by file -The `@nx/cypress/plugin` will automatically split your e2e tasks by file. You can read more about this feature [here](/ci/features/split-e2e-tasks). +The `@nx/cypress/plugin` will automatically split your e2e tasks by file. You can read more about the Atomizer feature [here](/ci/features/split-e2e-tasks). To enable e2e task splitting, make sure there is a `ciWebServerCommand` property set in your `cypress.config.ts` file. It will look something like this: diff --git a/docs/generated/packages/gradle/documents/overview.md b/docs/generated/packages/gradle/documents/overview.md index 081a4db6ed..2c56dd0675 100644 --- a/docs/generated/packages/gradle/documents/overview.md +++ b/docs/generated/packages/gradle/documents/overview.md @@ -68,7 +68,8 @@ The `@nx/gradle` is configured in the `plugins` array in `nx.json`. "options": { "testTargetName": "test", "classesTargetName": "classes", - "buildTargetName": "build" + "buildTargetName": "build", + "ciTargetName": "test-ci" } } ] @@ -77,6 +78,23 @@ The `@nx/gradle` is configured in the `plugins` array in `nx.json`. Once a Gradle configuration file has been identified, the targets are created with the name you specify under `testTargetName`, `classesTargetName` or `buildTargetName` in the `nx.json` `plugins` array. The default names for the inferred targets are `test`, `classes` and `build`. +### Splitting E2E Tests + +The `@nx/gradle` plugin will automatically split your e2e tasks by file if you provide a `ciTargetName`. You can read more about the Atomizer feature [here](/ci/features/split-e2e-tasks). This will create a target with that name which can be used in CI to run the tests for each file in a distributed fashion. + +```json {% fileName="nx.json" highlightLines=[6] %} +{ + "plugins": [ + { + "plugin": "@nx/gradle", + "options": { + "ciTargetName": "test-ci" + } + } + ] +} +``` + ## View Inferred Tasks To view inferred tasks for a project, open the [project details view](/features/explore-graph#explore-projects-in-your-workspace) in Nx Console or run `nx show project my-project --web` in the command line. diff --git a/docs/generated/packages/jest/documents/overview.md b/docs/generated/packages/jest/documents/overview.md index 7923cb998e..4d324041ff 100644 --- a/docs/generated/packages/jest/documents/overview.md +++ b/docs/generated/packages/jest/documents/overview.md @@ -70,7 +70,7 @@ within the same workspace. In this case, you can configure the `@nx/jest/plugin` ### Splitting E2E Tests If Jest is used to run E2E tests, you can enable [splitting the tasks](/ci/features/split-e2e-tasks) by file to get -improved caching, distribution, and retrying flaky tests. Enable this, by providing a `ciTargetName`. This will create a +improved caching, distribution, and retrying flaky tests. Enable this Atomizer feature by providing a `ciTargetName`. This will create a target with that name which can be used in CI to run the tests for each file in a distributed fashion. ```json {% fileName="nx.json" %} diff --git a/docs/generated/packages/playwright/documents/overview.md b/docs/generated/packages/playwright/documents/overview.md index 27371af3b1..c8ca99befc 100644 --- a/docs/generated/packages/playwright/documents/overview.md +++ b/docs/generated/packages/playwright/documents/overview.md @@ -65,6 +65,24 @@ The `@nx/playwright/plugin` is configured in the `plugins` array in `nx.json`. The `targetName` and `ciTargetName` options control the name of the inferred Playwright tasks. The default names are `e2e` and `e2e-ci`. +### Splitting E2E Tests + +The `@nx/playwright/plugin` will automatically split your e2e tasks by file if you provide a `ciTargetName`. You can read more about the Atomizer feature [here](/ci/features/split-e2e-tasks). This will create a target with that name which can be used in CI to run the tests for each file in a distributed fashion. + +```json {% fileName="nx.json" %} +{ + "plugins": [ + { + "plugin": "@nx/playwright/plugin", + "options": { + "targetName": "e2e", + "ciTargetName": "e2e-ci" + } + } + ] +} +``` + ### Splitting E2E tasks by file The `@nx/playwright/plugin` will automatically split your e2e tasks by file. You can read more about this feature [here](/ci/features/split-e2e-tasks). diff --git a/docs/nx-cloud/features/split-e2e-tasks.md b/docs/nx-cloud/features/split-e2e-tasks.md index 6691bb16ac..4514aea3f9 100644 --- a/docs/nx-cloud/features/split-e2e-tasks.md +++ b/docs/nx-cloud/features/split-e2e-tasks.md @@ -11,7 +11,7 @@ You could manually address these problems by splitting your e2e tests into small ## Set up -To enable atomized tasks, you need to turn on [inferred tasks](/concepts/inferred-tasks#existing-nx-workspaces) for the [@nx/cypress](/nx-api/cypress#splitting-e2e-tasks-by-file), [@nx/playwright](/nx-api/playwright#splitting-e2e-tasks-by-file), [@nx/jest](/nx-api/jest#splitting-e2e-tests) or [@nx/gradle](/nx-api/gradle) plugins. Run this command to set up inferred tasks: +To enable atomized tasks, you need to turn on [inferred tasks](/concepts/inferred-tasks#existing-nx-workspaces) for the [@nx/cypress](/nx-api/cypress#splitting-e2e-tasks-by-file), [@nx/playwright](/nx-api/playwright#splitting-e2e-tests), [@nx/jest](/nx-api/jest#splitting-e2e-tests) or [@nx/gradle](/nx-api/gradle#splitting-e2e-tests) plugins. Run this command to set up inferred tasks: {% tabs %} {% tab label="Cypress" %} diff --git a/docs/shared/packages/cypress/cypress-plugin.md b/docs/shared/packages/cypress/cypress-plugin.md index 0fda193d83..74bafa3d07 100644 --- a/docs/shared/packages/cypress/cypress-plugin.md +++ b/docs/shared/packages/cypress/cypress-plugin.md @@ -86,7 +86,7 @@ The `targetName`, `ciTargetName`, `componentTestingTargetName`, and `open-cypres ### Splitting E2E tasks by file -The `@nx/cypress/plugin` will automatically split your e2e tasks by file. You can read more about this feature [here](/ci/features/split-e2e-tasks). +The `@nx/cypress/plugin` will automatically split your e2e tasks by file. You can read more about the Atomizer feature [here](/ci/features/split-e2e-tasks). To enable e2e task splitting, make sure there is a `ciWebServerCommand` property set in your `cypress.config.ts` file. It will look something like this: diff --git a/docs/shared/packages/gradle/gradle-plugin.md b/docs/shared/packages/gradle/gradle-plugin.md index 081a4db6ed..2c56dd0675 100644 --- a/docs/shared/packages/gradle/gradle-plugin.md +++ b/docs/shared/packages/gradle/gradle-plugin.md @@ -68,7 +68,8 @@ The `@nx/gradle` is configured in the `plugins` array in `nx.json`. "options": { "testTargetName": "test", "classesTargetName": "classes", - "buildTargetName": "build" + "buildTargetName": "build", + "ciTargetName": "test-ci" } } ] @@ -77,6 +78,23 @@ The `@nx/gradle` is configured in the `plugins` array in `nx.json`. Once a Gradle configuration file has been identified, the targets are created with the name you specify under `testTargetName`, `classesTargetName` or `buildTargetName` in the `nx.json` `plugins` array. The default names for the inferred targets are `test`, `classes` and `build`. +### Splitting E2E Tests + +The `@nx/gradle` plugin will automatically split your e2e tasks by file if you provide a `ciTargetName`. You can read more about the Atomizer feature [here](/ci/features/split-e2e-tasks). This will create a target with that name which can be used in CI to run the tests for each file in a distributed fashion. + +```json {% fileName="nx.json" highlightLines=[6] %} +{ + "plugins": [ + { + "plugin": "@nx/gradle", + "options": { + "ciTargetName": "test-ci" + } + } + ] +} +``` + ## View Inferred Tasks To view inferred tasks for a project, open the [project details view](/features/explore-graph#explore-projects-in-your-workspace) in Nx Console or run `nx show project my-project --web` in the command line. diff --git a/docs/shared/packages/jest/jest-plugin.md b/docs/shared/packages/jest/jest-plugin.md index 7923cb998e..4d324041ff 100644 --- a/docs/shared/packages/jest/jest-plugin.md +++ b/docs/shared/packages/jest/jest-plugin.md @@ -70,7 +70,7 @@ within the same workspace. In this case, you can configure the `@nx/jest/plugin` ### Splitting E2E Tests If Jest is used to run E2E tests, you can enable [splitting the tasks](/ci/features/split-e2e-tasks) by file to get -improved caching, distribution, and retrying flaky tests. Enable this, by providing a `ciTargetName`. This will create a +improved caching, distribution, and retrying flaky tests. Enable this Atomizer feature by providing a `ciTargetName`. This will create a target with that name which can be used in CI to run the tests for each file in a distributed fashion. ```json {% fileName="nx.json" %} diff --git a/docs/shared/packages/playwright/playwright-plugin.md b/docs/shared/packages/playwright/playwright-plugin.md index 27371af3b1..c8ca99befc 100644 --- a/docs/shared/packages/playwright/playwright-plugin.md +++ b/docs/shared/packages/playwright/playwright-plugin.md @@ -65,6 +65,24 @@ The `@nx/playwright/plugin` is configured in the `plugins` array in `nx.json`. The `targetName` and `ciTargetName` options control the name of the inferred Playwright tasks. The default names are `e2e` and `e2e-ci`. +### Splitting E2E Tests + +The `@nx/playwright/plugin` will automatically split your e2e tasks by file if you provide a `ciTargetName`. You can read more about the Atomizer feature [here](/ci/features/split-e2e-tasks). This will create a target with that name which can be used in CI to run the tests for each file in a distributed fashion. + +```json {% fileName="nx.json" %} +{ + "plugins": [ + { + "plugin": "@nx/playwright/plugin", + "options": { + "targetName": "e2e", + "ciTargetName": "e2e-ci" + } + } + ] +} +``` + ### Splitting E2E tasks by file The `@nx/playwright/plugin` will automatically split your e2e tasks by file. You can read more about this feature [here](/ci/features/split-e2e-tasks).