OpenMetadata/.github/workflows/playwright-postgresql-e2e.yml
Shailesh Parmar a283702a4f
Upgrade Playwright from 1.51.1 to 1.57.0 (#24330)
* Upgrade Playwright from 1.51.1 to 1.54.2

- Updated @playwright/test package to version 1.54.2 in package.json
- Updated Playwright browser installation to 1.54.2 in all GitHub workflow files:
  - mysql-nightly-e2e.yml
  - playwright-mysql-e2e.yml
  - playwright-postgresql-e2e.yml
  - postgresql-nightly-e2e.yml
- Updated yarn.lock to reflect the new Playwright version and its dependencies

Using 1.54.2 instead of 1.56.x to avoid regression bug with "Internal error: step id not found"
that affects fixtures in Playwright 1.55+ (see microsoft/playwright#37147).

This upgrade brings stable Playwright features, improvements, and bug fixes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: update Playwright tests and utility functions for improved query handling and response validation

* fix: update URL wait conditions in Data Insight tests for accurate navigation

* fix: refine search response handling in verifyDeletedEntityNotVisible function

* fix: correct Playwright worker configuration in workflow files

- Fixed missing backslash continuation in playwright-postgresql-e2e.yml causing --workers=50% to be ignored
- Added missing --workers=50% flag in else block of playwright-postgresql-e2e.yml
- Fixed missing backslash continuation in postgresql-nightly-e2e.yml
- Fixed missing backslash continuation in mysql-nightly-e2e.yml

These syntax errors caused Playwright tests to run with unlimited workers (default CPU cores × 2),
leading to resource exhaustion and GitHub Actions runner communication failures. With this fix,
tests will properly run with 50% workers (1 worker on 2-core runners) preventing memory/CPU starvation.

* fix: increase Playwright worker count to 75% in workflow files

* fix: update Playwright tests to use correct role selectors and encode query parameters

* fix: reduce Playwright worker count from 75% to 50% in CI workflows

* fixed failing test

* fix: remove worker count specification from Playwright test commands in CI workflows

* fix: update Playwright test commands to specify worker count and adjust ESLint ignore settings

* fix: reduce worker count in Playwright configurations to prevent resource exhaustion

* fix: change waitForLoadState from 'networkidle' to 'domcontentloaded' in redirectToHomePage function

* fix: increase worker count to 3 in Playwright config and add navigation timeout to prevent hangs

* fix: reduce worker count to 2 in Playwright config to optimize resource usage

* Upgrade Playwright from 1.51.1 to 1.56.1

- Updated @playwright/test package to version 1.56.1 in package.json
- Updated Playwright browser installation to 1.56.1 in all GitHub workflow files:
  - mysql-nightly-e2e.yml
  - playwright-mysql-e2e.yml
  - playwright-postgresql-e2e.yml
  - postgresql-nightly-e2e.yml
- Updated yarn.lock to reflect the new Playwright version and its dependencies
- Reduced workers from 4 to 2 in playwright.config.ts to prevent resource exhaustion
- Added navigationTimeout: 60000 to prevent infinite hangs on networkidle waits
- Changed networkidle to domcontentloaded in redirectToHomePage function

This upgrade brings the latest stable Playwright features, improvements, and bug fixes while addressing resource exhaustion issues.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix: downgrade Playwright to version 1.55.1 in workflow files and package.json

* chore: upgrade Playwright to version 1.57.0 in workflow files and package.json

* trying firfox

* chore: upgrade Playwright to version 1.57.0 in OpenMetadata

- Updated @playwright/test package to version 1.57.0 in package.json
- Updated Playwright browser installation to 1.57.0 in all GitHub workflow files:
  - mysql-nightly-e2e.yml
  - playwright-postgresql-e2e.yml
  - postgresql-nightly-e2e.yml
- Updated yarn.lock to reflect the new Playwright version and its dependencies
- Maintained Chromium browser configuration for all test projects
- Kept worker optimization at 2 workers and --workers=50% flag for resource management

This upgrade brings the latest stable Playwright features, improvements, and bug fixes, including resolution of the "step id not found" regression bug.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* chore: update Playwright trace configuration to 'on-first-retry'

* revert worker setting

* fix failing test

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com>
2025-12-31 17:06:09 +05:30

205 lines
9.1 KiB
YAML

# Copyright 2021 Collate
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This workflow executes end-to-end (e2e) tests using Playwright with PostgreSQL as the database.
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
name: Postgresql PR Playwright E2E Tests
on:
workflow_dispatch:
pull_request_target:
types:
- labeled
- opened
- synchronize
- reopened
- ready_for_review
paths-ignore:
- '.github/**'
- 'openmetadata-dist/**'
- 'docker/**'
- '!docker/development/docker-compose.yml'
- '!docker/development/docker-compose-postgres.yml'
permissions:
contents: read
concurrency:
group: playwright-ci-pr-postgresql-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
playwright-ci-postgresql:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
environment: test
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3, 4, 5, 6]
shardTotal: [6]
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
swap-storage: true
docker-images: false
- name: Wait for the labeler
uses: lewagon/wait-on-check-action@v1.3.4
if: ${{ github.event_name == 'pull_request_target' }}
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: Team Label
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 90
- name: Verify PR labels
uses: jesusvasquez333/verify-pr-label-action@v1.4.0
if: ${{ github.event_name == 'pull_request_target' }}
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
valid-labels: "safe to test"
pull-request-number: "${{ github.event.pull_request.number }}"
disable-reviews: true # To not auto approve changes
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Cache Maven Dependencies
id: cache-output
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup Openmetadata Test Environment
uses: ./.github/actions/setup-openmetadata-test-environment
with:
python-version: "3.10"
args: "-d postgresql"
ingestion_dependency: "all"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: 'openmetadata-ui/src/main/resources/ui/.nvmrc'
- name: Install dependencies
working-directory: openmetadata-ui/src/main/resources/ui/
run: yarn --ignore-scripts --frozen-lockfile
- name: Install Playwright Browsers
run: npx playwright@1.57.0 install --with-deps
- name: Run Playwright tests
working-directory: openmetadata-ui/src/main/resources/ui/
run: |
if [ "${{ matrix.shardIndex }}" -eq "1" ]; then
echo "🔹 Running DataAssetRules-only tests on shard 1"
# The testMatch pattern ensures only DataAssetRules*.spec.ts files run
npx playwright test \
--project=setup \
--project=DataAssetRulesEnabled \
--project=DataAssetRulesDisabled
else
# Shards 2-6 handle chromium tests (5 workers total)
CHROMIUM_SHARD=$(( ${{ matrix.shardIndex }} - 1 ))
if [[ "${{ contains(github.event.pull_request.changed_files, 'ingestion/') }}" == "true" ]]; then
echo "🔹 Running ingestion tests on chromium shard ${CHROMIUM_SHARD}/5"
npx playwright test \
--project=chromium \
--grep @ingestion \
--grep-invert @dataAssetRules \
--shard=${CHROMIUM_SHARD}/5
--workers=50%
else
echo "🔹 Running all other tests (excluding DataAssetRules) on chromium shard ${CHROMIUM_SHARD}/5"
npx playwright test \
--project=chromium \
--grep-invert @dataAssetRules \
--shard=${CHROMIUM_SHARD}/5
fi
fi
env:
PLAYWRIGHT_IS_OSS: true
PLAYWRIGHT_SNOWFLAKE_USERNAME: ${{ secrets.TEST_SNOWFLAKE_USERNAME }}
PLAYWRIGHT_SNOWFLAKE_PASSWORD: ${{ secrets.TEST_SNOWFLAKE_PASSWORD }}
PLAYWRIGHT_SNOWFLAKE_ACCOUNT: ${{ secrets.TEST_SNOWFLAKE_ACCOUNT }}
PLAYWRIGHT_SNOWFLAKE_DATABASE: ${{ secrets.TEST_SNOWFLAKE_DATABASE }}
PLAYWRIGHT_SNOWFLAKE_WAREHOUSE: ${{ secrets.TEST_SNOWFLAKE_WAREHOUSE }}
PLAYWRIGHT_SNOWFLAKE_PASSPHRASE: ${{ secrets.TEST_SNOWFLAKE_PASSPHRASE }}
PLAYWRIGHT_PROJECT_ID: ${{ steps.cypress-project-id.outputs.CYPRESS_PROJECT_ID }}
PLAYWRIGHT_BQ_PRIVATE_KEY: ${{ secrets.TEST_BQ_PRIVATE_KEY }}
PLAYWRIGHT_BQ_PROJECT_ID: ${{ secrets.TEST_BQ_PROJECT_ID }}
PLAYWRIGHT_BQ_PRIVATE_KEY_ID: ${{ secrets.TEST_BQ_PRIVATE_KEY_ID }}
PLAYWRIGHT_BQ_PROJECT_ID_TAXONOMY: ${{ secrets.TEST_BQ_PROJECT_ID_TAXONOMY }}
PLAYWRIGHT_BQ_CLIENT_EMAIL: ${{ secrets.TEST_BQ_CLIENT_EMAIL }}
PLAYWRIGHT_BQ_CLIENT_ID: ${{ secrets.TEST_BQ_CLIENT_ID }}
PLAYWRIGHT_REDSHIFT_HOST: ${{ secrets.E2E_REDSHIFT_HOST_PORT }}
PLAYWRIGHT_REDSHIFT_USERNAME: ${{ secrets.E2E_REDSHIFT_USERNAME }}
PLAYWRIGHT_REDSHIFT_PASSWORD: ${{ secrets.E2E_REDSHIFT_PASSWORD }}
PLAYWRIGHT_REDSHIFT_DATABASE: ${{ secrets.TEST_REDSHIFT_DATABASE }}
PLAYWRIGHT_METABASE_USERNAME: ${{ secrets.TEST_METABASE_USERNAME }}
PLAYWRIGHT_METABASE_PASSWORD: ${{ secrets.TEST_METABASE_PASSWORD }}
PLAYWRIGHT_METABASE_DB_SERVICE_NAME: ${{ secrets.TEST_METABASE_DB_SERVICE_NAME }}
PLAYWRIGHT_METABASE_HOST_PORT: ${{ secrets.TEST_METABASE_HOST_PORT }}
PLAYWRIGHT_SUPERSET_USERNAME: ${{ secrets.TEST_SUPERSET_USERNAME }}
PLAYWRIGHT_SUPERSET_PASSWORD: ${{ secrets.TEST_SUPERSET_PASSWORD }}
PLAYWRIGHT_SUPERSET_HOST_PORT: ${{ secrets.TEST_SUPERSET_HOST_PORT }}
PLAYWRIGHT_KAFKA_BOOTSTRAP_SERVERS: ${{ secrets.TEST_KAFKA_BOOTSTRAP_SERVERS }}
PLAYWRIGHT_KAFKA_SCHEMA_REGISTRY_URL: ${{ secrets.TEST_KAFKA_SCHEMA_REGISTRY_URL }}
PLAYWRIGHT_GLUE_ACCESS_KEY: ${{ secrets.TEST_GLUE_ACCESS_KEY }}
PLAYWRIGHT_GLUE_SECRET_KEY: ${{ secrets.TEST_GLUE_SECRET_KEY }}
PLAYWRIGHT_GLUE_AWS_REGION: ${{ secrets.TEST_GLUE_AWS_REGION }}
PLAYWRIGHT_GLUE_ENDPOINT: ${{ secrets.TEST_GLUE_ENDPOINT }}
PLAYWRIGHT_GLUE_STORAGE_SERVICE: ${{ secrets.TEST_GLUE_STORAGE_SERVICE }}
PLAYWRIGHT_MYSQL_USERNAME: ${{ secrets.TEST_MYSQL_USERNAME }}
PLAYWRIGHT_MYSQL_PASSWORD: ${{ secrets.TEST_MYSQL_PASSWORD }}
PLAYWRIGHT_MYSQL_HOST_PORT: ${{ secrets.TEST_MYSQL_HOST_PORT }}
PLAYWRIGHT_MYSQL_DATABASE_SCHEMA: ${{ secrets.TEST_MYSQL_DATABASE_SCHEMA }}
PLAYWRIGHT_POSTGRES_USERNAME: ${{ secrets.TEST_POSTGRES_USERNAME }}
PLAYWRIGHT_POSTGRES_PASSWORD: ${{ secrets.TEST_POSTGRES_PASSWORD }}
PLAYWRIGHT_POSTGRES_HOST_PORT: ${{ secrets.TEST_POSTGRES_HOST_PORT }}
PLAYWRIGHT_POSTGRES_DATABASE: ${{ secrets.TEST_POSTGRES_DATABASE }}
PLAYWRIGHT_AIRFLOW_HOST_PORT: ${{ secrets.TEST_AIRFLOW_HOST_PORT }}
PLAYWRIGHT_ML_MODEL_TRACKING_URI: ${{ secrets.TEST_ML_MODEL_TRACKING_URI }}
PLAYWRIGHT_ML_MODEL_REGISTRY_URI: ${{ secrets.TEST_ML_MODEL_REGISTRY_URI }}
PLAYWRIGHT_S3_STORAGE_ACCESS_KEY_ID: ${{ secrets.TEST_S3_STORAGE_ACCESS_KEY_ID }}
PLAYWRIGHT_S3_STORAGE_SECRET_ACCESS_KEY: ${{ secrets.TEST_S3_STORAGE_SECRET_ACCESS_KEY }}
PLAYWRIGHT_S3_STORAGE_END_POINT_URL: ${{ secrets.TEST_S3_STORAGE_END_POINT_URL }}
# Recommended: pass the GitHub token lets this action correctly
# determine the unique run id necessary to re-run the checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report-${{ matrix.shardIndex }}
path: openmetadata-ui/src/main/resources/ui/playwright/output/playwright-report
retention-days: 5
- name: Clean Up
run: |
cd ./docker/development
docker compose down --remove-orphans
sudo rm -rf ${PWD}/docker-volume