fix(playwright): remove Google Sheets dependency from dataset tests#39143
fix(playwright): remove Google Sheets dependency from dataset tests#39143sadpandajoe wants to merge 5 commits intomasterfrom
Conversation
Replace external Google Sheets dependency in Playwright dataset tests with self-contained data seeding using the examples database and SQL Lab API. Tests no longer require network access to public spreadsheets or the gsheets DB engine connector. - Enable allow_dml on examples DB in CI playwright_testdata() setup - Add sqllab.ts helper for SQL Lab execute API - Add apiExportDatasets() for export-then-reimport test pattern - Rewrite create-dataset tests to use SQL Lab temp tables - Rewrite import test to use export-then-reimport (no static fixture) - Delete dataset_export.zip fixture (was GSheets-based) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #39143 +/- ##
=======================================
Coverage 64.45% 64.45%
=======================================
Files 2541 2541
Lines 131662 131662
Branches 30517 30517
=======================================
Hits 84863 84863
Misses 45333 45333
Partials 1466 1466
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…onent - Add expectDeleted() to assertions.ts — replaces 9 identical expect.poll(...apiGet...404) blocks across chart, dashboard, and dataset list tests - Add uploadFileBuffer() to ImportDatasetModal — use component method instead of raw page.locator for buffer uploads - Remove unused apiGetDashboard import from dashboard-list Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR removes the external Google Sheets dependency from Playwright dataset E2E tests by switching data seeding to use the built-in examples database and SQL Lab / export APIs, improving reliability in CI and isolated environments.
Changes:
- Enable
allow_dmlon theexamplesdatabase in CI test data setup to allow SQL Lab DDL for test seeding. - Add Playwright API helpers (
apiExecuteSql,apiExportDatasets) and a shared deletion assertion (expectDeleted). - Refactor dataset tests to use SQL Lab CTAS temp tables and an export-then-reimport import test pattern; remove the static GSheets-based zip fixture.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
superset-frontend/playwright/tests/dataset/dataset-list.spec.ts |
Replaces fixture-based import with export-then-reimport; uses shared deletion assertion. |
superset-frontend/playwright/tests/dataset/create-dataset.spec.ts |
Seeds physical tables in examples via SQL Lab instead of GSheets; runs wizard tests serially. |
superset-frontend/playwright/tests/dashboard/dashboard-list.spec.ts |
Uses shared expectDeleted helper instead of inline polling. |
superset-frontend/playwright/tests/chart/chart-list.spec.ts |
Uses shared expectDeleted helper instead of inline polling. |
superset-frontend/playwright/helpers/api/sqllab.ts |
Adds apiExecuteSql() helper for SQL Lab execution API. |
superset-frontend/playwright/helpers/api/dataset.ts |
Adds apiExportDatasets() helper for dataset export API. |
superset-frontend/playwright/helpers/api/assertions.ts |
Adds shared expectDeleted() polling assertion. |
superset-frontend/playwright/components/modals/ImportDatasetModal.ts |
Adds buffer-based zip upload to avoid temp files. |
.github/workflows/bashlib.sh |
Sets allow_dml=True on examples DB in Playwright test data setup. |
superset-frontend/playwright/fixtures/dataset_export.zip |
Removes no-longer-needed static fixture. |
superset-frontend/playwright/tests/dataset/dataset-list.spec.ts
Outdated
Show resolved
Hide resolved
- Prefix unused testAssets param with underscore in setupExamplesDataset - Fail CI early if examples database not found in bashlib.sh - Extract imported dataset ID from response body instead of re-querying by name, with fallback for robustness Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
superset-frontend/playwright/tests/dataset/create-dataset.spec.ts
Outdated
Show resolved
Hide resolved
CI examples DB is always PostgreSQL, so 'public' is the correct and intentional schema choice. Add inline comments at each usage site to make this assumption explicit for future readers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code Review Agent Run #41fe57Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
SUMMARY
Removes the external Google Sheets dependency from Playwright dataset E2E tests. Tests now seed their own data using the built-in
examplesdatabase and SQL Lab API, making them fully self-contained and reliable in CI.Why this matters: The previous tests depended on a public Google Sheets spreadsheet and the
gsheetsDB engine connector. When the sheet was unavailable or the connector wasn't installed, tests silently skipped or failed — making CI flaky and preventing tests from running in isolated environments.Approach:
test_pw_<timestamp>_<index>) instead of connecting to an external spreadsheetallow_dmlis enabled on the examples DB in CI setup (bashlib.sh), not at test runtimeexpectDeleted()helper that replaces 9 duplicate polling blocks across chart, dashboard, and dataset list testsReviewer notes:
'public'schema is hard-coded intentionally — CI examples DB is always PostgreSQL. Inline comments explain this at each usage site.@googleapis/sheetsis NOT removed frompackage.json— it's still used byoxlint-metrics-uploader.js, unrelated to tests.test.describeincreate-dataset.spec.tsdeviates from the project's "avoid nesting" guideline — it's required because Playwright's serial mode API needs a describe block.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — test infrastructure only, no UI changes
TESTING INSTRUCTIONS
CI validation via the
superset-playwright.ymlworkflow. To run locally:PLAYWRIGHT_BASE_URL=http://localhost:9007 PLAYWRIGHT_ADMIN_PASSWORD=admin \ npx playwright test tests/dataset/ --reporter=listADDITIONAL INFORMATION
dataset_export.zipfixture