From a702744ead86b6ee2e8c01960cd7f32eb43fe59b Mon Sep 17 00:00:00 2001 From: shortstacked Date: Tue, 2 Sep 2025 12:47:57 +0100 Subject: [PATCH] test: Add performance test CI nightly (#19088) --- .../setup-nodejs-blacksmith/action.yml | 4 +-- .../playwright-test-docker-build.yml | 1 + .../workflows/playwright-test-docker-pull.yml | 1 + .../workflows/playwright-test-performance.yml | 19 ++++++++++++ .../workflows/playwright-test-reusable.yml | 30 +++++++++++-------- 5 files changed, 40 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/playwright-test-performance.yml diff --git a/.github/actions/setup-nodejs-blacksmith/action.yml b/.github/actions/setup-nodejs-blacksmith/action.yml index bacaa619b2..f4df26107e 100644 --- a/.github/actions/setup-nodejs-blacksmith/action.yml +++ b/.github/actions/setup-nodejs-blacksmith/action.yml @@ -33,9 +33,9 @@ runs: - name: Configure Turborepo Cache uses: useblacksmith/caching-for-turbo@bafb57e7ebdbf1185762286ec94d24648cd3938a # v1 - - name: Setup Blacksmith Buildx for Docker Cache + - name: Setup Docker Builder for Docker Cache if: ${{ inputs.enable-docker-cache == 'true' }} - uses: useblacksmith/build-push-action@574eb0ee0b59c6a687ace24192f0727dfb65d6d7 # v1.2.0 + uses: useblacksmith/setup-docker-builder@0b434dfbb431f4e3a2bcee7a773a56bd363184c5 # v1 - name: Build Project run: ${{ inputs.build-command }} diff --git a/.github/workflows/playwright-test-docker-build.yml b/.github/workflows/playwright-test-docker-build.yml index 41b1fb4b20..4661f05330 100644 --- a/.github/workflows/playwright-test-docker-build.yml +++ b/.github/workflows/playwright-test-docker-build.yml @@ -10,4 +10,5 @@ jobs: uses: ./.github/workflows/playwright-test-reusable.yml with: test-mode: docker-build + test-command: pnpm --filter=n8n-playwright test:container:standard secrets: inherit diff --git a/.github/workflows/playwright-test-docker-pull.yml b/.github/workflows/playwright-test-docker-pull.yml index 233ef7a648..b294963be1 100644 --- a/.github/workflows/playwright-test-docker-pull.yml +++ b/.github/workflows/playwright-test-docker-pull.yml @@ -34,4 +34,5 @@ jobs: test-mode: docker-pull shards: ${{ inputs.shards }} docker-image: ${{ inputs.image }} + test-command: pnpm --filter=n8n-playwright test:container:standard secrets: inherit diff --git a/.github/workflows/playwright-test-performance.yml b/.github/workflows/playwright-test-performance.yml new file mode 100644 index 0000000000..3146c78399 --- /dev/null +++ b/.github/workflows/playwright-test-performance.yml @@ -0,0 +1,19 @@ +name: Run Playwright Performance Tests + +on: + workflow_call: + workflow_dispatch: + schedule: + - cron: '0 0 * * *' # Runs daily at midnight + pull_request: + paths: + - '.github/workflows/playwright-test-performance.yml' + +jobs: + build-and-test-performance: + uses: ./.github/workflows/playwright-test-reusable.yml + with: + test-mode: docker-build + test-command: pnpm --filter=n8n-playwright test:performance + shards: '[1]' + secrets: inherit diff --git a/.github/workflows/playwright-test-reusable.yml b/.github/workflows/playwright-test-reusable.yml index 717c3401fa..a0b1277829 100644 --- a/.github/workflows/playwright-test-reusable.yml +++ b/.github/workflows/playwright-test-reusable.yml @@ -8,6 +8,11 @@ on: required: false default: 'local' type: string + test-command: + description: 'Test command to run' + required: false + default: 'pnpm --filter=n8n-playwright test:local' + type: string shards: description: 'Shards for parallel execution' required: false @@ -22,6 +27,12 @@ on: secrets: CURRENTS_RECORD_KEY: required: true + QA_PERFORMANCE_METRICS_WEBHOOK_URL: + required: true + QA_PERFORMANCE_METRICS_WEBHOOK_USER: + required: true + QA_PERFORMANCE_METRICS_WEBHOOK_PASSWORD: + required: true env: PLAYWRIGHT_BROWSERS_PATH: packages/testing/playwright/ms-playwright-cache @@ -53,25 +64,18 @@ jobs: env: INCLUDE_TEST_CONTROLLER: ${{ inputs.test-mode == 'docker-build' && 'true' || '' }} - - name: Install Browsers (Docker Build) + - name: Install Browsers if: inputs.test-mode == 'docker-build' run: pnpm turbo install-browsers:ci - - name: Run Tests (Local) - if: inputs.test-mode == 'local' + - name: Run Tests run: | - pnpm --filter=n8n-playwright test:local \ - --shard=${{ matrix.shard }}/${{ strategy.job-total }} \ - --workers=${{ env.PLAYWRIGHT_WORKERS }} - env: - CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }} - - - name: Run Tests (Docker) - if: inputs.test-mode != 'local' - run: | - pnpm --filter=n8n-playwright test:container:standard \ + ${{ inputs.test-command }} \ --shard=${{ matrix.shard }}/${{ strategy.job-total }} \ --workers=${{ env.PLAYWRIGHT_WORKERS }} env: N8N_DOCKER_IMAGE: ${{ inputs.test-mode == 'docker-build' && 'n8nio/n8n:local' || inputs.docker-image }} CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }} + QA_PERFORMANCE_METRICS_WEBHOOK_URL: ${{ secrets.QA_PERFORMANCE_METRICS_WEBHOOK_URL }} + QA_PERFORMANCE_METRICS_WEBHOOK_USER: ${{ secrets.QA_PERFORMANCE_METRICS_WEBHOOK_USER }} + QA_PERFORMANCE_METRICS_WEBHOOK_PASSWORD: ${{ secrets.QA_PERFORMANCE_METRICS_WEBHOOK_PASSWORD }}