mirror of
https://github.com/apache/superset.git
synced 2026-06-12 11:09:15 +00:00
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: hainenber <dotronghai96@gmail.com>
173 lines
6.4 KiB
YAML
173 lines
6.4 KiB
YAML
name: Playwright Experimental Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "master"
|
|
- "[0-9].[0-9]*"
|
|
pull_request:
|
|
types: [synchronize, opened, reopened, ready_for_review]
|
|
workflow_dispatch:
|
|
inputs:
|
|
ref:
|
|
description: "The branch or tag to checkout"
|
|
required: false
|
|
default: ""
|
|
pr_id:
|
|
description: "The pull request ID to checkout"
|
|
required: false
|
|
default: ""
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
changes:
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 10
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
outputs:
|
|
python: ${{ steps.check.outputs.python }}
|
|
frontend: ${{ steps.check.outputs.frontend }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
persist-credentials: false
|
|
- name: Check for file changes
|
|
id: check
|
|
uses: ./.github/actions/change-detector/
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# NOTE: Required Playwright tests are in superset-e2e.yml (E2E / playwright-tests)
|
|
# This workflow contains only experimental tests that run in shadow mode
|
|
playwright-tests-experimental:
|
|
needs: changes
|
|
if: needs.changes.outputs.python == 'true' || needs.changes.outputs.frontend == 'true'
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 30
|
|
continue-on-error: true
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
browser: ["chromium"]
|
|
app_root: ["", "/app/prefix"]
|
|
env:
|
|
SUPERSET_ENV: development
|
|
SUPERSET_CONFIG: tests.integration_tests.superset_test_config
|
|
SUPERSET__SQLALCHEMY_DATABASE_URI: postgresql+psycopg2://superset:superset@127.0.0.1:15432/superset
|
|
PYTHONPATH: ${{ github.workspace }}
|
|
REDIS_PORT: 16379
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
services:
|
|
postgres:
|
|
image: postgres:17-alpine
|
|
env:
|
|
POSTGRES_USER: superset
|
|
POSTGRES_PASSWORD: superset
|
|
ports:
|
|
- 15432:5432
|
|
redis:
|
|
image: redis:7-alpine
|
|
ports:
|
|
- 16379:6379
|
|
steps:
|
|
# -------------------------------------------------------
|
|
# Conditional checkout based on context (same as Cypress workflow)
|
|
- name: Checkout for push or pull_request event
|
|
if: github.event_name == 'push' || github.event_name == 'pull_request'
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
persist-credentials: false
|
|
submodules: recursive
|
|
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
|
|
- name: Checkout using ref (workflow_dispatch)
|
|
if: github.event_name == 'workflow_dispatch' && github.event.inputs.ref != ''
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
persist-credentials: false
|
|
ref: ${{ github.event.inputs.ref }}
|
|
submodules: recursive
|
|
- name: Checkout using PR ID (workflow_dispatch)
|
|
if: github.event_name == 'workflow_dispatch' && github.event.inputs.pr_id != ''
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
persist-credentials: false
|
|
ref: refs/pull/${{ github.event.inputs.pr_id }}/merge
|
|
submodules: recursive
|
|
# -------------------------------------------------------
|
|
- name: Setup Python
|
|
uses: ./.github/actions/setup-backend/
|
|
- name: Setup postgres
|
|
uses: ./.github/actions/cached-dependencies
|
|
with:
|
|
run: setup-postgres
|
|
- name: Import test data
|
|
uses: ./.github/actions/cached-dependencies
|
|
with:
|
|
run: playwright_testdata
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
|
|
with:
|
|
node-version-file: "./superset-frontend/.nvmrc"
|
|
cache: "npm"
|
|
cache-dependency-path: "superset-frontend/package-lock.json"
|
|
- name: Install npm dependencies
|
|
uses: ./.github/actions/cached-dependencies
|
|
with:
|
|
run: npm-install
|
|
- name: Build javascript packages
|
|
uses: ./.github/actions/cached-dependencies
|
|
with:
|
|
run: build-instrumented-assets
|
|
- name: Build embedded SDK
|
|
uses: ./.github/actions/cached-dependencies
|
|
with:
|
|
run: build-embedded-sdk
|
|
- name: Install Playwright
|
|
uses: ./.github/actions/cached-dependencies
|
|
with:
|
|
run: playwright-install
|
|
- name: Run Playwright (Experimental Tests)
|
|
uses: ./.github/actions/cached-dependencies
|
|
env:
|
|
NODE_OPTIONS: "--max-old-space-size=4096"
|
|
with:
|
|
run: playwright-run "${{ matrix.app_root }}" experimental/
|
|
- name: Run Playwright (Embedded Tests)
|
|
uses: ./.github/actions/cached-dependencies
|
|
env:
|
|
NODE_OPTIONS: "--max-old-space-size=4096"
|
|
# Scope embedded-only env vars to this step. Setting them at the job
|
|
# level enabled the EMBEDDED_SUPERSET feature flag inside Flask for
|
|
# the preceding "Required Tests" and "Experimental Tests" steps too,
|
|
# which loads extra handlers and destabilizes the werkzeug dev
|
|
# server under the 2-worker Playwright load. Required Tests should
|
|
# match master's Flask configuration.
|
|
SUPERSET_FEATURE_EMBEDDED_SUPERSET: "true"
|
|
INCLUDE_EMBEDDED: "true"
|
|
with:
|
|
run: playwright-run "${{ matrix.app_root }}" embedded
|
|
- name: Set safe app root
|
|
if: failure()
|
|
id: set-safe-app-root
|
|
run: |
|
|
APP_ROOT="${{ matrix.app_root }}"
|
|
SAFE_APP_ROOT=${APP_ROOT//\//_}
|
|
echo "safe_app_root=$SAFE_APP_ROOT" >> $GITHUB_OUTPUT
|
|
- name: Upload Playwright Artifacts
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
|
|
if: failure()
|
|
with:
|
|
path: |
|
|
${{ github.workspace }}/superset-frontend/playwright-results/
|
|
${{ github.workspace }}/superset-frontend/test-results/
|
|
name: playwright-experimental-artifact-${{ github.run_id }}-${{ github.job }}-${{ matrix.browser }}--${{ steps.set-safe-app-root.outputs.safe_app_root }}
|