From cc29c4da74a8ee1db860d2ecdc8c3f4dc515c6f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Wed, 19 Jul 2023 14:15:38 +0200 Subject: [PATCH] ci: Fix test workflows (no-changelog) (#6698) * ci: Fix test workflows (no-changelog) We removed `pdf-parse` in #6640, so we need to get these test PDF files from the `test-workflows` repo instead ([which has been updated to include these files](https://github.com/n8n-io/test-workflows/commit/0f6ef1c804e3f1e919b097bdf061ea9ea095b1e2)) * remove `\n` from ids and skipList text files --- .github/workflows/test-workflows.yml | 3 +-- packages/cli/src/commands/executeBatch.ts | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-workflows.yml b/.github/workflows/test-workflows.yml index 8f23d10a1..78fa52e28 100644 --- a/.github/workflows/test-workflows.yml +++ b/.github/workflows/test-workflows.yml @@ -64,8 +64,7 @@ jobs: run: | cp n8n/assets/n8n-logo.png /tmp/n8n-logo.png cp n8n/assets/n8n-screenshot.png /tmp/n8n-screenshot.png - cp n8n/node_modules/pdf-parse/test/data/05-versions-space.pdf /tmp/05-versions-space.pdf - cp n8n/node_modules/pdf-parse/test/data/04-valid.pdf /tmp/04-valid.pdf + cp test-workflows/testData/pdfs/*.pdf /tmp/ shell: bash - name: Run tests diff --git a/packages/cli/src/commands/executeBatch.ts b/packages/cli/src/commands/executeBatch.ts index b1586b895..cc2470c74 100644 --- a/packages/cli/src/commands/executeBatch.ts +++ b/packages/cli/src/commands/executeBatch.ts @@ -232,7 +232,12 @@ export class ExecuteBatch extends BaseCommand { if (flags.ids !== undefined) { if (fs.existsSync(flags.ids)) { const contents = fs.readFileSync(flags.ids, { encoding: 'utf-8' }); - ids.push(...contents.split(',').filter((id) => re.exec(id))); + ids.push( + ...contents + .trimEnd() + .split(',') + .filter((id) => re.exec(id)), + ); } else { const paramIds = flags.ids.split(','); const matchedIds = paramIds.filter((id) => re.exec(id)); @@ -251,7 +256,12 @@ export class ExecuteBatch extends BaseCommand { if (flags.skipList !== undefined) { if (fs.existsSync(flags.skipList)) { const contents = fs.readFileSync(flags.skipList, { encoding: 'utf-8' }); - skipIds.push(...contents.split(',').filter((id) => re.exec(id))); + skipIds.push( + ...contents + .trimEnd() + .split(',') + .filter((id) => re.exec(id)), + ); } else { console.log('Skip list file not found. Exiting.'); return;