fix(ci): load all examples for Playwright E2E tests

**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 <noreply@anthropic.com>
This commit is contained in:
Joe Li
2025-11-13 21:45:42 -08:00
parent 022cd3c2e4
commit 8eb510f21a
2 changed files with 14 additions and 1 deletions

View File

@@ -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"

View File

@@ -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