From 309c9953646f535d22a0bd94b198294d0a18b12a Mon Sep 17 00:00:00 2001 From: agobrech <45268029+agobrech@users.noreply.github.com> Date: Fri, 10 Feb 2023 17:11:06 +0100 Subject: [PATCH] test: Change workflows to test from safe list to skip list (#5457) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove check by safe list to skip list * add an option to skip using statistics events --------- Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ --- .github/workflows/test-workflows.yml | 3 ++- packages/cli/src/events/index.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-workflows.yml b/.github/workflows/test-workflows.yml index 7802f5d2c8..2a26fcf9c2 100644 --- a/.github/workflows/test-workflows.yml +++ b/.github/workflows/test-workflows.yml @@ -73,10 +73,11 @@ jobs: shell: bash - name: Run tests - run: n8n/packages/cli/bin/n8n executeBatch --shallow --ids=test-workflows/safeList.txt --shortOutput --concurrency=16 --compare=test-workflows/snapshots + run: n8n/packages/cli/bin/n8n executeBatch --shallow --skipList=test-workflows/skipList.txt --shortOutput --concurrency=16 --compare=test-workflows/snapshots shell: bash env: N8N_ENCRYPTION_KEY: ${{secrets.ENCRYPTION_KEY}} + SKIP_STATISTICS_EVENTS: true # - # name: Export credentials # if: always() diff --git a/packages/cli/src/events/index.ts b/packages/cli/src/events/index.ts index d2d29a7538..a73a848f75 100644 --- a/packages/cli/src/events/index.ts +++ b/packages/cli/src/events/index.ts @@ -2,6 +2,8 @@ import { eventEmitter } from 'n8n-core'; import { nodeFetchedData, workflowExecutionCompleted } from './WorkflowStatistics'; export function initEvents() { + if ('SKIP_STATISTICS_EVENTS' in process.env) return; + // Check for undefined as during testing these functions end up undefined for some reason if (nodeFetchedData) { eventEmitter.on(eventEmitter.types.nodeFetchedData, nodeFetchedData);