From cef18973901fa409cf8df69b010cc8c1b3e3c334 Mon Sep 17 00:00:00 2001 From: Nils Haberkamp Date: Thu, 8 Feb 2024 14:49:41 +0100 Subject: [PATCH] NEXT-33446 - move e2e job from admin sdk to root of repository --- .github/workflows/tests.yml | 32 +++++++++++++++++++ package.json | 3 +- .../admin-sdk/.github/workflows/tests.yml | 32 ------------------- packages/admin-sdk/package.json | 8 ++--- turbo.json | 3 +- 5 files changed, 40 insertions(+), 38 deletions(-) delete mode 100644 packages/admin-sdk/.github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ab51e7198..0633d2738 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -90,3 +90,35 @@ jobs: - name: madge run: pnpm --filter @shopware-ag/meteor-admin-sdk run circular-dependencies + + playwright-run: + name: Playwright Integration Tests + timeout-minutes: 20 + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v2 + with: + version: 8 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install dependencies + run: pnpm install + + - name: Install Playwright + run: npx playwright install + + - name: Run Playwright tests + run: pnpm run test:e2e + + - uses: actions/upload-artifact@v2 + if: always() + with: + name: playwright-test-results + path: playwright-report/ diff --git a/package.json b/package.json index 9cce88c30..04e707f68 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "lint:eslint": "turbo run lint:eslint", "format": "turbo run format", "format:check": "turbo run format:check", - "test:unit": "turbo run test:unit" + "test:unit": "turbo run test:unit", + "test:e2e": "turbo run test:e2e" }, "keywords": [], "license": "MIT", diff --git a/packages/admin-sdk/.github/workflows/tests.yml b/packages/admin-sdk/.github/workflows/tests.yml deleted file mode 100644 index 24bc41b52..000000000 --- a/packages/admin-sdk/.github/workflows/tests.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Tests - -on: push - -jobs: - playwright-run: - name: Playwright Integration Tests - timeout-minutes: 20 - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Node.js - uses: actions/setup-node@v3 - - name: Retrieve the cached "node_modules" directory (if present) - uses: actions/cache@v3 - id: node-cache - with: - path: node_modules - key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} - - name: Install dependencies (if the cached directory was not found) - if: steps.node-cache.outputs.cache-hit != 'true' - run: npm ci - - name: Install Playwright - run: npx playwright install - - name: Run Playwright tests - run: npm run e2e - - uses: actions/upload-artifact@v2 - if: always() - with: - name: playwright-test-results - path: playwright-report/ \ No newline at end of file diff --git a/packages/admin-sdk/package.json b/packages/admin-sdk/package.json index 5aba88ec2..a609c7639 100644 --- a/packages/admin-sdk/package.json +++ b/packages/admin-sdk/package.json @@ -77,10 +77,10 @@ "lint:eslint": "eslint ./src --ext .ts", "test:unit": "jest --collectCoverage", "test:unit:watch": "jest --watch", - "e2e": "concurrently --handle-input --kill-others --success first \"npm run dev\" \"wait-on http://127.0.0.1:8181 && wait-on http://127.0.0.1:8182 && playwright test\"", - "e2e:dev": "playwright test --project=chromium --reporter=list", - "e2e:dev-watch": "chokidar \"{e2e,src}/**/*.{js,ts}\" -c 'clear && npm run e2e:dev' --initial", - "e2e:dev-debug": "PWDEBUG=1 npm run e2e:dev", + "test:e2e": "concurrently --handle-input --kill-others --success first \"npm run dev\" \"wait-on http://127.0.0.1:8181 && wait-on http://127.0.0.1:8182 && playwright test\"", + "test:e2e:dev": "playwright test --project=chromium --reporter=list", + "test:e2e:dev-watch": "chokidar \"{e2e,src}/**/*.{js,ts}\" -c 'clear && npm run e2e:dev' --initial", + "test:e2e:dev-debug": "PWDEBUG=1 npm run e2e:dev", "prepublish": "npm run build", "circular-dependencies": "madge --circular --warning src", "circular-dependencies:image": "madge --circular --warning --image ./dependency-graph.png src" diff --git a/turbo.json b/turbo.json index 5db77870c..8ba5da6ca 100644 --- a/turbo.json +++ b/turbo.json @@ -10,6 +10,7 @@ "lint:eslint": {}, "format": {}, "format:check": {}, - "test:unit": {} + "test:unit": {}, + "test:e2e": {} } }