Browse Source

Merge pull request #4360 from nocodb/fix/playwright-ci-improvements

fix(test): Maximum timeout for each instance is 30 minutes and improved quick test CI configuration
pull/4367/head
Muhammed Mustafa 2 years ago committed by GitHub
parent
commit
202c816ca4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 38
      .github/workflows/playwright-test-workflow.yml
  2. 1
      packages/nc-gui/tests/playwright/.gitignore
  3. 3
      packages/nocodb/package.json

38
.github/workflows/playwright-test-workflow.yml

@ -14,6 +14,7 @@ on:
jobs:
playwright:
runs-on: ubuntu-20.04
timeout-minutes: 30
steps:
# Reference: https://github.com/pierotofy/set-swap-space/blob/master/action.yml
- name: Set 5gb swap
@ -69,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') }}
**/packages/nc-gui/tests/playwright/node_modules
key: cache-nc-playwright-${{ hashFiles('**/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
@ -102,16 +105,33 @@ jobs:
run: |
kill -9 $(lsof -t -i:8080)
npm run watch:run:playwright:pg:cyquick &
cd ../nc-gui/tests/playwright
npm run test:quick
- name: Run quick server and tests (sqlite)
if: ${{ inputs.db == 'sqlite' && inputs.shard == '2' }}
working-directory: ./packages/nocodb
run: |
kill -9 $(lsof -t -i:8080)
npm run watch:run:playwright:quick &
cd ../nc-gui/tests/playwright
npm run test: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
run: |
while ! curl --output /dev/null --silent --head --fail http://localhost:8080; do
printf '.'
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:
name: playwright-report-quick-${{ inputs.shard }}
path: ./packages/nc-gui/tests/playwright/playwright-report-quick/
retention-days: 2
- uses: actions/upload-artifact@v3
if: always()
@ -123,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

1
packages/nc-gui/tests/playwright/.gitignore vendored

@ -2,6 +2,7 @@ node_modules/
/test-results/
/playwright-report/
/playwright-report copy/
/playwright-report-quick/
/playwright/.cache/
.env
output

3
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"

Loading…
Cancel
Save