Skip to content

fix(playwright): remove Google Sheets dependency from dataset tests#39143

Open
sadpandajoe wants to merge 5 commits intomasterfrom
fix-playwright-gsheet-dependency
Open

fix(playwright): remove Google Sheets dependency from dataset tests#39143
sadpandajoe wants to merge 5 commits intomasterfrom
fix-playwright-gsheet-dependency

Conversation

@sadpandajoe
Copy link
Copy Markdown
Member

@sadpandajoe sadpandajoe commented Apr 6, 2026

SUMMARY

Removes the external Google Sheets dependency from Playwright dataset E2E tests. Tests now seed their own data using the built-in examples database 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 gsheets DB 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:

  • Tests create unique temp tables via SQL Lab CTAS (test_pw_<timestamp>_<index>) instead of connecting to an external spreadsheet
  • The import/export test uses an export-then-reimport pattern (export an existing dataset, delete it, reimport from the export) — no static fixture files to maintain
  • allow_dml is enabled on the examples DB in CI setup (bashlib.sh), not at test runtime
  • Extracted a shared expectDeleted() helper that replaces 9 duplicate polling blocks across chart, dashboard, and dataset list tests

Reviewer notes:

  • 'public' schema is hard-coded intentionally — CI examples DB is always PostgreSQL. Inline comments explain this at each usage site.
  • @googleapis/sheets is NOT removed from package.json — it's still used by oxlint-metrics-uploader.js, unrelated to tests.
  • The test.describe in create-dataset.spec.ts deviates 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.yml workflow. To run locally:

PLAYWRIGHT_BASE_URL=http://localhost:9007 PLAYWRIGHT_ADMIN_PASSWORD=admin \
  npx playwright test tests/dataset/ --reporter=list

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration
  • Introduces new feature or API
  • Removes existing feature or API
    • Removes Google Sheets dependency from test infrastructure
    • Deletes static dataset_export.zip fixture

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>
@github-actions github-actions bot added the github_actions Pull requests that update GitHub Actions code label Apr 6, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.45%. Comparing base (5f9fc31) to head (93f9c84).

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           
Flag Coverage Δ
javascript 66.06% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_dml on the examples database 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.

- 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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

sadpandajoe and others added 2 commits April 7, 2026 11:26
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>
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Apr 7, 2026

Code Review Agent Run #41fe57

Actionable Suggestions - 0
Review Details
  • Files reviewed - 9 · Commit Range: 8d32b0c..93f9c84
    • .github/workflows/bashlib.sh
    • superset-frontend/playwright/components/modals/ImportDatasetModal.ts
    • superset-frontend/playwright/helpers/api/assertions.ts
    • superset-frontend/playwright/helpers/api/dataset.ts
    • superset-frontend/playwright/helpers/api/sqllab.ts
    • superset-frontend/playwright/tests/chart/chart-list.spec.ts
    • superset-frontend/playwright/tests/dashboard/dashboard-list.spec.ts
    • superset-frontend/playwright/tests/dataset/create-dataset.spec.ts
    • superset-frontend/playwright/tests/dataset/dataset-list.spec.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code review:draft size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants