test: remove cypress + migrate existing tests to playwright (#4781)

* test: remove cypress + migrate existing tests to playwright + update workflows

* ci: remove leftover condition in ci-run-tests workflow

* ci: add missing matrix to tests-playwright-legacy

* ci: run playwright legacy as user 1001

* ci: set home var for firefox

* ci: allow firefox to run as root for tests
This commit is contained in:
Nicolas Giard 2022-11-22 17:26:19 -05:00 committed by GitHub
parent 72648dc01c
commit deb01f2d83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
169 changed files with 5387 additions and 3631 deletions

View file

@ -72,6 +72,7 @@
"vue.volar", "vue.volar",
"mrmlnc.vscode-duplicate", "mrmlnc.vscode-duplicate",
"ms-azuretools.vscode-docker", "ms-azuretools.vscode-docker",
"ms-playwright.playwright",
"ms-python.python", "ms-python.python",
"ms-python.vscode-pylance", "ms-python.vscode-pylance",
"mtxr.sqltools-driver-mysql", "mtxr.sqltools-driver-mysql",

View file

@ -11,7 +11,7 @@ services:
- /workspace/.vite - /workspace/.vite
- /workspace/.yarn/unplugged - /workspace/.yarn/unplugged
- app-assets:/assets - app-assets:/assets
- datatracker-vscode-ext:/root/.vscode-server/extensions # - datatracker-vscode-ext:/root/.vscode-server/extensions
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:db network_mode: service:db

View file

@ -9,8 +9,7 @@ module.exports = {
}, },
extends: [ extends: [
// 'plugin:vue/vue3-essential', // Priority A: Essential (Error Prevention) // 'plugin:vue/vue3-essential', // Priority A: Essential (Error Prevention)
'plugin:vue/vue3-strongly-recommended', // Priority B: Strongly Recommended (Improving Readability) 'plugin:vue/vue3-strongly-recommended' // Priority B: Strongly Recommended (Improving Readability)
'plugin:cypress/recommended'
], ],
globals: { globals: {
d3: true d3: true

View file

@ -222,8 +222,8 @@ jobs:
path: playwright/test-results/ path: playwright/test-results/
if-no-files-found: ignore if-no-files-found: ignore
tests-cypress: tests-playwright-legacy:
name: Run Tests (Cypress) name: Run Tests (Playwright Legacy)
if: ${{ github.event.inputs.skiptests == 'false' }} if: ${{ github.event.inputs.skiptests == 'false' }}
needs: [prepare] needs: [prepare]
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -262,26 +262,26 @@ jobs:
/usr/local/bin/wait-for localhost:8000 -- echo "Datatracker ready" /usr/local/bin/wait-for localhost:8000 -- echo "Datatracker ready"
- name: Run all tests - name: Run all tests
env:
HOME: ""
run: | run: |
echo "Installing dependencies..."
yarn
echo "Installing Playwright..."
cd playwright
mkdir test-results
npm ci
npx playwright install --with-deps ${{ matrix.project }}
echo "Running tests..." echo "Running tests..."
yarn cypress:legacy npx playwright test --project=${{ matrix.project }} -c playwright-legacy.config.js
- name: Upload Video Recordings - name: Upload Report
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
if: ${{ always() }} if: ${{ always() }}
continue-on-error: true continue-on-error: true
with: with:
name: videos-legacy name: playwright-legacy-results-${{ matrix.project }}
path: cypress/videos/ path: playwright/test-results/
if-no-files-found: ignore
- name: Upload Screenshots
uses: actions/upload-artifact@v3
if: ${{ always() }}
continue-on-error: true
with:
name: screenshots-modern
path: cypress/screenshots/
if-no-files-found: ignore if-no-files-found: ignore
# ----------------------------------------------------------------- # -----------------------------------------------------------------
@ -290,7 +290,7 @@ jobs:
release: release:
name: Make Release name: Make Release
if: ${{ always() }} if: ${{ always() }}
needs: [tests-python, tests-playwright, tests-cypress, prepare] needs: [tests-python, tests-playwright, tests-playwright-legacy, prepare]
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
SHOULD_DEPLOY: ${{needs.prepare.outputs.should_deploy}} SHOULD_DEPLOY: ${{needs.prepare.outputs.should_deploy}}

View file

@ -110,3 +110,67 @@ jobs:
name: playwright-results-${{ matrix.project }} name: playwright-results-${{ matrix.project }}
path: playwright/test-results/ path: playwright/test-results/
if-no-files-found: ignore if-no-files-found: ignore
tests-playwright-legacy:
name: Run Tests (Playwright Legacy)
runs-on: ubuntu-latest
container: ghcr.io/ietf-tools/datatracker-app-base:latest
strategy:
fail-fast: false
matrix:
project: [chromium, firefox]
services:
db:
image: ghcr.io/ietf-tools/datatracker-db:latest
volumes:
- mariadb-data:/var/lib/mysql
env:
MYSQL_ROOT_PASSWORD: ietf
MYSQL_DATABASE: ietf_utf8
MYSQL_USER: django
MYSQL_PASSWORD: RkTkDPFnKpko
steps:
- uses: actions/checkout@v3
- name: Prepare for tests
run: |
chmod +x ./dev/tests/prepare.sh
sh ./dev/tests/prepare.sh
- name: Ensure DB is ready
run: |
/usr/local/bin/wait-for db:3306 -- echo "DB ready"
- name: Start Datatracker
run: |
echo "Running checks..."
./ietf/manage.py check
echo "Starting datatracker..."
./ietf/manage.py runserver 0.0.0.0:8000 --settings=settings_local &
echo "Waiting for datatracker to be ready..."
/usr/local/bin/wait-for localhost:8000 -- echo "Datatracker ready"
- name: Run all tests
env:
HOME: ""
run: |
echo "Installing dependencies..."
yarn
echo "Installing Playwright..."
cd playwright
mkdir test-results
npm ci
npx playwright install --with-deps ${{ matrix.project }}
echo "Running tests..."
npx playwright test --project=${{ matrix.project }} -c playwright-legacy.config.js
- name: Upload Report
uses: actions/upload-artifact@v3
if: ${{ always() }}
continue-on-error: true
with:
name: playwright-legacy-results-${{ matrix.project }}
path: playwright/test-results/
if-no-files-found: ignore

1596
.pnp.cjs generated

File diff suppressed because it is too large Load diff

Some files were not shown because too many files have changed in this diff Show more