Commit Graph
2 Commits
Author SHA1 Message Date
Joshen Lim 60b51d74d5 Audit existing unit tests + Remove redundant ones (#52215)
## Context

_TLDR: Changes here speeds up unit tests on CI from ~14 minutes to ~3
minutes_ 😂
_TLDR 2: The file changes are solely only test files +
`studio-unit-tests.yml`_

We've currently got a lot of unit tests in the repository which while
great for coverage, hasn't been ideally written. There's a lot of
redundancy + overly specific tests that break easily, and our current
unit test takes about 15 minutes to run in the GHA per PR. Hence am
doing a audit clean up of all existing unit tests in the studio repo.

## Changes involved
- `.test.ts` files now run in `node`, `.test.tsx` in `jsdom`
- jsdom costs about 1s of setup per file. A `.ts` test that needs the
DOM opts in with `// @vitest-environment jsdom` (46 files do).
- Removed redundant and over-specific tests
- Duplicates are merged into `test.each`. Tests that only covered
libraries, existed for coverage, or asserted class names and snapshots
are deleted. 19 files are merged into a sibling or deleted.
- Fixed about 15 tests that couldn't fail 
- Examples: unawaited assertions, fixtures equal to the default, and a
`semverGte` test calling `semverLte`.
- Sped up the slowest files 
- Real sleeps are replaced with fake timers, `user.type` with paste, and
Radix option queries are scoped to the open listbox. For example,
`RestoringState` went from 18s to 0.3s and
`useTableEditorFiltersSort.navigation` from 20s to 3s.
- These ^ already shave down the unit tests time from 14 mins to 9 mins,
but am also sharding unit tests across 4 jobs to increase speed up
further which then shaves down time to 3 mins now
2026-10-23 18:51:27 +08:00
Danny White f20277377b feat(studio): add pipeline data and custom settings review (#51635)
## Problem

The pipeline wizard in #49243 needs publication, initial sync and custom
settings reviewed before creation.

## Solution

Extend the preview-enabled review from #51633 with Data, custom
connection settings and configured BigQuery table layouts. Values update
as fields change. Unchanged advanced defaults and unconfigured table
layouts are omitted; an explicit maximum staleness of zero is shown.

Preview off and editing keep their existing layout. Validation and
creation behaviour stay the same; no wizard routing is added. Stacked on
#51633.

| This PR: Simple Case | This PR: Extreme Case | Reference: Final Wizard
|
| --- | --- | --- |
| <img width="1244" height="1994" alt="CleanShot 2026-10-14 at 11 22
16@2x"
src="https://github.com/user-attachments/assets/5c2c9ea4-7b2b-4f0b-8ebe-0cfc2ac27059"
/> | <img width="1226" height="3568" alt="CleanShot 2026-10-14 at 12 02
16@2x"
src="https://github.com/user-attachments/assets/dc556d4a-5130-4b6c-80b5-8644603d9a55"
/> | <img width="1486" height="2364" alt="CleanShot 2026-10-14 at 10 50
30@2x"
src="https://github.com/user-attachments/assets/982b7d23-9449-4841-b002-9e30fbbabfe9"
/> |

## Review instructions

1. Open the [Pipelines
preview](https://studio-staging-git-dnywh-featpipeline-data-review-supabase.vercel.app/dashboard/project/_/database/pipelines),
select a test project with Pipelines enabled, enable **Pipeline creation
wizard** in Feature Previews and click **Add pipeline**. Confirm
**Data** review follows the destination review.
2. Select a publication. Confirm its name, table count and initial-sync
choice appear as read-only fields. Choose selected tables to include or
exclude and confirm their schema-qualified names appear. Change
publication and confirm old tables are not shown.
3. Under Data’s **Advanced settings**, change batch wait time, table
sync workers or initial sync connections. Confirm only custom values
appear in review. Restore defaults and confirm those rows disappear. For
BigQuery, configure partitioning or clustering and confirm the table
name and wrapping layout summary appear in the main column under **Table
layout**; unconfigured layouts should be omitted.
4. Change BigQuery connection pool size or maximum staleness and confirm
they appear within **Connection**. If available, check DuckLake pool
size and Snowflake role too. Check desktop and phone widths, then cancel
and discard changes; no credentials or creation are needed.
5. Turn the preview off and reopen **Add pipeline**: confirm no review.
With the preview on, edit an existing pipeline and confirm no review
there either.
2026-10-15 11:17:34 +11:00