Browse Source

feat(testing): Added pg to CI

pull/4278/head
Muhammed Mustafa 2 years ago
parent
commit
daaddcd626
  1. 7
      .github/workflows/ci-cd.yml
  2. 6
      .github/workflows/playwright-test-workflow.yml
  3. 4
      scripts/playwright/package.json
  4. 2
      scripts/playwright/scripts/docker-compose-pg-pw-quick.yml
  5. 2
      scripts/playwright/scripts/docker-compose-pg.yml

7
.github/workflows/ci-cd.yml

@ -70,4 +70,9 @@ jobs:
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
uses: ./.github/workflows/playwright-test-workflow.yml
with:
db: mysql
db: mysql
playwright-pg:
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
uses: ./.github/workflows/playwright-test-workflow.yml
with:
db: pg

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

@ -54,6 +54,10 @@ jobs:
if: ${{ inputs.db == 'mysql' }}
working-directory: ./
run: docker-compose -f ./scripts/playwright/scripts/docker-compose-playwright.yml up -d &
- name: setup pg
if: ${{ inputs.db == 'pg' }}
working-directory: ./
run: docker-compose -f ./scripts/playwright/scripts/docker-compose-pg.yml up -d &
- name: run frontend
working-directory: ./packages/nc-gui
run: npm run ci:run
@ -82,7 +86,7 @@ jobs:
done
- name: Run Playwright tests
working-directory: ./scripts/playwright
run: npm run ci:test:mysql
run: E2E_DB_TYPE=${{ inputs.db }} npm run ci:test
- uses: actions/upload-artifact@v3
if: always()
with:

4
scripts/playwright/package.json

@ -9,7 +9,9 @@
"test:quick": "TRACE=true PW_QUICK_TEST=1 npx playwright test --workers=4",
"test:debug": "./startPlayWrightServer.sh; PW_TEST_REUSE_CONTEXT=1 PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:31000/ PWDEBUG=console npx playwright test -c playwright.config.ts --headed --project=chromium --retries 0 --timeout 0 --workers 1 --max-failures=1",
"test:debug:quick:sqlite": "./startPlayWrightServer.sh; PW_QUICK_TEST=1 PW_TEST_REUSE_CONTEXT=1 PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:31000/ PWDEBUG=console npx playwright test -c playwright.config.ts --headed --project=chromium --retries 0 --timeout 5 --workers 1 --max-failures=1",
"ci:test:mysql": "E2E_DB_TYPE=mysql npx playwright test --workers=2"
"ci:test": "npx playwright test --workers=2",
"ci:test:mysql": "E2E_DB_TYPE=mysql npx playwright test --workers=2",
"ci:test:pg": "E2E_DB_TYPE=pg npx playwright test --workers=2"
},
"keywords": [],
"author": "",

2
scripts/playwright/scripts/docker-compose-pg-pw-quick.yml

@ -9,7 +9,7 @@ services:
ports:
- 5432:5432
volumes:
- ../../packages/nocodb/tests/pg-cy-quick:/docker-entrypoint-initdb.d
- ../../../packages/nocodb/tests/pg-cy-quick:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s

2
scripts/playwright/scripts/docker-compose-pg.yml

@ -9,7 +9,7 @@ services:
ports:
- 5432:5432
volumes:
- ../../packages/nocodb/tests/pg-sakila-db:/docker-entrypoint-initdb.d
- ../../../packages/nocodb/tests/pg-sakila-db:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s

Loading…
Cancel
Save