From badc15e5f936032fbf5783b5e790da852cb67915 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Fri, 11 Nov 2022 11:43:21 +0530 Subject: [PATCH] fix(test): Added github artifact for quick tests and potential fix for playwright node module GH CI cache issue --- .github/workflows/playwright-test-workflow.yml | 18 +++++++++++++----- packages/nc-gui/tests/playwright/.gitignore | 1 + packages/nocodb/package.json | 3 +-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/playwright-test-workflow.yml b/.github/workflows/playwright-test-workflow.yml index d4cddeae65..ea5b388c40 100644 --- a/.github/workflows/playwright-test-workflow.yml +++ b/.github/workflows/playwright-test-workflow.yml @@ -70,14 +70,16 @@ jobs: run: npm run ci:run - name: Run backend working-directory: ./packages/nocodb - run: npm run ci:run & + run: | + npm install + npm run watch:run:playwright & > ${{ inputs.db }}_${{ inputs.shard }}_test_backend.log - name: Cache playwright npm modules uses: actions/cache@v3 id: playwright-cache with: path: | - **/playwright/node_modules - key: cache-nc-playwright-${{ hashFiles('**/playwright/package-lock.json') }} + **/nocodb/packages/nc-gui/tests/playwright/node_modules + key: cache-nc-playwright-${{ hashFiles('**/nocodb/packages/nc-gui/tests/playwright/package-lock.json') }} - name: Install dependencies if: steps.playwright-cache.outputs.cache-hit != 'true' working-directory: ./packages/nc-gui/tests/playwright @@ -108,7 +110,7 @@ jobs: working-directory: ./packages/nocodb run: | kill -9 $(lsof -t -i:8080) - npm run watch:run:playwright:quick & + npm run watch:run:playwright:quick & > quick_${{ inputs.shard }}_test_backend.log - name: Wait for backend & run quick tests if: ${{ inputs.db == 'sqlite' }} working-directory: ./packages/nc-gui/tests/playwright @@ -118,6 +120,12 @@ jobs: sleep 2 done PLAYWRIGHT_HTML_REPORT=playwright-report-quick npm run test:quick + - uses: actions/upload-artifact@v3 + if: ${{ inputs.db == 'sqlite' }} + with: + name: quick-backend-log-${{ inputs.shard }} + path: ./packages/nocodb/quick_${{ inputs.shard }}_test_backend.log + retention-days: 2 - uses: actions/upload-artifact@v3 if: ${{ inputs.db == 'sqlite' }} with: @@ -135,5 +143,5 @@ jobs: if: always() with: name: backend-logs-${{ inputs.db }}-${{ inputs.shard }} - path: ./packages/nocodb/mysql_test_backend.log + path: ./packages/nocodb/${{ inputs.db }}_${{ inputs.shard }}_test_backend.log retention-days: 2 \ No newline at end of file diff --git a/packages/nc-gui/tests/playwright/.gitignore b/packages/nc-gui/tests/playwright/.gitignore index 6f9fb63fd1..63c301ee05 100644 --- a/packages/nc-gui/tests/playwright/.gitignore +++ b/packages/nc-gui/tests/playwright/.gitignore @@ -2,6 +2,7 @@ node_modules/ /test-results/ /playwright-report/ /playwright-report copy/ +/playwright-report-quick/ /playwright/.cache/ .env output diff --git a/packages/nocodb/package.json b/packages/nocodb/package.json index 07535cceaf..7e7c1bda8d 100644 --- a/packages/nocodb/package.json +++ b/packages/nocodb/package.json @@ -46,8 +46,7 @@ "watch:run:pg": "cross-env NC_DISABLE_TELE=true EE=true nodemon -e ts,js -w ./src -x \"ts-node src/run/dockerRunPG --log-error --project tsconfig.json\"", "run": "ts-node src/run/docker", "watch:try": "nodemon -e ts,js -w ./src -x \"ts-node src/run/try --log-error --project tsconfig.json\"", - "example:docker": "ts-node src/run/docker.ts", - "ci:run": "npm install; npm run watch:run:playwright > mysql_test_backend.log" + "example:docker": "ts-node src/run/docker.ts" }, "engines": { "node": ">=8.9"