From 8eb510f21aecd847ba59e76503651b69b420b36c Mon Sep 17 00:00:00 2001 From: Joe Li Date: Thu, 13 Nov 2025 21:45:42 -0800 Subject: [PATCH] fix(ci): load all examples for Playwright E2E tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Problem**: Playwright duplicate test fails in CI because `members_channels_2` dataset is not loaded with `--load-test-data` flag. The `--load-test-data` flag only loads files matching `*.test.*` pattern (e.g., `unicode_test.test.yaml`). Regular example datasets like `members_channels_2.yaml` are skipped, causing the duplicate dataset test to fail with null. **Root Cause**: - CI uses `superset load_examples --load-test-data` (line 115 in bashlib.sh) - This loads ONLY `*.test.*` files (1 dataset: unicode_test) - Playwright test expects `members_channels_2` virtual dataset - Ephemeral environments use `superset load_examples` (all datasets) **Solution**: Create separate data loading function for Playwright 1. Added `playwright_testdata()` function in bashlib.sh: - Loads ALL examples via `superset load_examples` (no flag) - Includes all 17 datasets (16 virtual + 1 test) - Matches ephemeral environment behavior 2. Updated superset-e2e.yml: - Playwright job now uses `playwright_testdata` instead of `testdata` - Cypress tests still use `testdata` (unchanged) **Impact**: - ✅ Playwright tests can use realistic example datasets - ✅ Matches ephemeral environment data availability - ✅ No impact on Cypress tests (still use --load-test-data) - ⏱️ CI data loading ~30-60s slower (acceptable tradeoff) **Testing**: Will be validated by CI run after push 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/bashlib.sh | 13 +++++++++++++ .github/workflows/superset-e2e.yml | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bashlib.sh b/.github/workflows/bashlib.sh index 1289d07259e..362f39a474a 100644 --- a/.github/workflows/bashlib.sh +++ b/.github/workflows/bashlib.sh @@ -117,6 +117,19 @@ testdata() { say "::endgroup::" } +playwright_testdata() { + cd "$GITHUB_WORKSPACE" + say "::group::Load all examples for Playwright tests" + # must specify PYTHONPATH to make `tests.superset_test_config` importable + export PYTHONPATH="$GITHUB_WORKSPACE" + pip install -e . + superset db upgrade + superset load_test_users + superset load_examples + superset init + say "::endgroup::" +} + celery-worker() { cd "$GITHUB_WORKSPACE" say "::group::Start Celery worker" diff --git a/.github/workflows/superset-e2e.yml b/.github/workflows/superset-e2e.yml index 1e074980498..6a0017a5e18 100644 --- a/.github/workflows/superset-e2e.yml +++ b/.github/workflows/superset-e2e.yml @@ -223,7 +223,7 @@ jobs: if: steps.check.outputs.python || steps.check.outputs.frontend uses: ./.github/actions/cached-dependencies with: - run: testdata + run: playwright_testdata - name: Setup Node.js if: steps.check.outputs.python || steps.check.outputs.frontend uses: actions/setup-node@v5