From f8b3759af38046500fdb083e3357cdcfbbfbe842 Mon Sep 17 00:00:00 2001 From: Max Kless Date: Tue, 16 Jul 2024 11:51:03 +0200 Subject: [PATCH] fix(core): pass env vars to e2es that are relevant for atomizer --- docs/generated/packages/nx/executors/atomizer.json | 2 +- e2e/jest/src/jest.test.ts | 5 ++++- e2e/next/src/next.test.ts | 3 ++- packages/nx/src/executors/atomizer/schema.json | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/generated/packages/nx/executors/atomizer.json b/docs/generated/packages/nx/executors/atomizer.json index 0513b238163ee1..8a39ae64ea05f3 100644 --- a/docs/generated/packages/nx/executors/atomizer.json +++ b/docs/generated/packages/nx/executors/atomizer.json @@ -4,7 +4,7 @@ "schema": { "version": 2, "title": "Atomizer", - "description": "An executor that is used as the root task for atomized tasks. Ensures it's being run in distribution and otherwise does nothing.", + "description": "An executor that is used as the root task for atomized tasks. Ensures it's being run in distribution and otherwise does nothing. [Learn more about the Atomizer, its benefits and why you should only run it with distribution.](https://nx.dev/ci/features/split-e2e-tasks#benefits) ", "type": "object", "cli": "nx", "outputCapture": "pipe", diff --git a/e2e/jest/src/jest.test.ts b/e2e/jest/src/jest.test.ts index 7234d398ba8dda..ed37920c46baa7 100644 --- a/e2e/jest/src/jest.test.ts +++ b/e2e/jest/src/jest.test.ts @@ -2,6 +2,7 @@ import { stripIndents } from '@angular-devkit/core/src/utils/literals'; import { cleanupProject, expectJestTestsToPass, + getStrippedEnvironmentVariables, newProject, runCLI, runCLIAsync, @@ -163,7 +164,9 @@ describe('Jest', () => { await runCLIAsync(`e2e-ci ${libName}`, { env: { - NX_SKIP_ATOMIZER_VALIDATION: 'true', + ...getStrippedEnvironmentVariables(), + // e2e-ci will only run with DTE so we set this for local testing + NX_AGENT_NAME: process.env['NX_AGENT_NAME'] ?? 'fake-agent-00', }, }); }, 90000); diff --git a/e2e/next/src/next.test.ts b/e2e/next/src/next.test.ts index 1a289ec1340c9f..9eea96c38883aa 100644 --- a/e2e/next/src/next.test.ts +++ b/e2e/next/src/next.test.ts @@ -196,7 +196,8 @@ describe('Next.js Applications', () => { const e2eResults = runCLI(`e2e-ci ${appName}-e2e --verbose`, { verbose: true, env: { - NX_SKIP_ATOMIZER_VALIDATION: 'true', + // e2e-ci will only run with DTE so we set this for local testing + NX_AGENT_NAME: process.env['NX_AGENT_NAME'] ?? 'fake-agent-00', }, }); expect(e2eResults).toContain( diff --git a/packages/nx/src/executors/atomizer/schema.json b/packages/nx/src/executors/atomizer/schema.json index ef1ed287943b95..08d2316aecceb3 100644 --- a/packages/nx/src/executors/atomizer/schema.json +++ b/packages/nx/src/executors/atomizer/schema.json @@ -1,7 +1,7 @@ { "version": 2, "title": "Atomizer", - "description": "An executor that is used as the root task for atomized tasks. Ensures it's being run in distribution and otherwise does nothing.", + "description": "An executor that is used as the root task for atomized tasks. Ensures it's being run in distribution and otherwise does nothing. [Learn more about the Atomizer, its benefits and why you should only run it with distribution.](https://nx.dev/ci/features/split-e2e-tasks#benefits) ", "type": "object", "cli": "nx", "outputCapture": "pipe",