Skip to content

Commit 2da59e8

Browse files
Mike Bridgeclaude
andcommitted
test(datasource-editor): defer Playwright tests to follow-up
Removes the Playwright spec and unused fixture helpers added in e111c5c / b346b27. The first CI run revealed: - getByLabel('Default URL') doesn't resolve because Field/TextControl don't wire htmlFor/aria-labelledby on the input — the label renders as a separate FormLabel header element above the input. - The duplicate-column-name error doesn't render in the dialog body; it surfaces only as the disabled Save button's tooltip text per DatasourceModal:355-370. Fixing both selector strategies plus iterating through CI cycles isn't worth blocking the perf fix on. The unit test for the unmount-drain path (T031b in 73e2ab9) covers the most subtle behavioural contract, and the existing 26 Jest tests cover the synchronous validation semantics. End-to-end Playwright coverage for typing cadence and validation flow is desirable but deferred to a separate PR. Reverts: - superset-frontend/playwright/helpers/api/dataset.ts (createWideTestDataset) - superset-frontend/playwright/tests/dataset/dataset-test-helpers.ts (createWideTestDatasetForTest) - superset-frontend/playwright/tests/dataset/dataset-editor-typing.spec.ts (deleted) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 44f13b9 commit 2da59e8

3 files changed

Lines changed: 1 addition & 298 deletions

File tree

superset-frontend/playwright/helpers/api/dataset.ts

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -137,58 +137,6 @@ export async function createTestVirtualDataset(
137137
return body.result?.id ?? body.id ?? null;
138138
}
139139

140-
/**
141-
* Creates a virtual dataset with N columns for typing-perf tests.
142-
* Uses a SELECT projection of N integer aliases (`col_0` … `col_{N-1}`) so
143-
* the resulting dataset has the requested column count without depending on
144-
* a specific physical table. Defaults to 50 columns to match SC-001's "50-
145-
* column dataset" benchmark in spec.md.
146-
*
147-
* @param page - Playwright page instance
148-
* @param name - Name for the virtual dataset
149-
* @param columnCount - Number of columns to project (default 50)
150-
* @param databaseId - ID of the database to use (looks up 'examples' DB if not provided)
151-
* @returns The created dataset ID, or null on failure
152-
*/
153-
export async function createWideTestDataset(
154-
page: Page,
155-
name: string,
156-
columnCount = 50,
157-
databaseId?: number,
158-
): Promise<number | null> {
159-
let dbId = databaseId;
160-
if (dbId === undefined) {
161-
const examplesDb = await getDatabaseByName(page, 'examples');
162-
if (!examplesDb?.id) {
163-
console.warn('Failed to find examples database');
164-
return null;
165-
}
166-
dbId = examplesDb.id;
167-
}
168-
169-
const projections = Array.from(
170-
{ length: columnCount },
171-
(_, i) => `${i} as col_${i}`,
172-
).join(', ');
173-
const sql = `SELECT ${projections}`;
174-
175-
const response = await apiPostVirtualDataset(page, {
176-
database: dbId,
177-
schema: '',
178-
table_name: name,
179-
sql,
180-
owners: [],
181-
});
182-
183-
if (!response.ok()) {
184-
console.warn(`Failed to create wide virtual dataset: ${response.status()}`);
185-
return null;
186-
}
187-
188-
const body = await response.json();
189-
return body.result?.id ?? body.id ?? null;
190-
}
191-
192140
/**
193141
* Get a dataset by its table name
194142
* @param page - Playwright page instance (provides authentication context)

superset-frontend/playwright/tests/dataset/dataset-editor-typing.spec.ts

Lines changed: 0 additions & 206 deletions
This file was deleted.

superset-frontend/playwright/tests/dataset/dataset-test-helpers.ts

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919

2020
import type { Page, TestInfo } from '@playwright/test';
2121
import type { TestAssets } from '../../helpers/fixtures';
22-
import {
23-
createTestVirtualDataset,
24-
createWideTestDataset,
25-
} from '../../helpers/api/dataset';
22+
import { createTestVirtualDataset } from '../../helpers/api/dataset';
2623

2724
interface TestDatasetResult {
2825
id: number;
@@ -34,11 +31,6 @@ interface CreateTestDatasetOptions {
3431
prefix?: string;
3532
}
3633

37-
interface CreateWideTestDatasetOptions extends CreateTestDatasetOptions {
38-
/** Number of columns to project in the virtual dataset (default 50). */
39-
columnCount?: number;
40-
}
41-
4234
/**
4335
* Creates a test virtual dataset.
4436
* Uses createTestVirtualDataset() to create a simple virtual dataset for testing.
@@ -73,34 +65,3 @@ export async function createTestDataset(
7365

7466
return { id, name };
7567
}
76-
77-
/**
78-
* Creates a wide virtual dataset (default 50 columns) for typing-perf tests.
79-
* The dataset's columns are auto-named `col_0` … `col_{N-1}` from the SQL
80-
* projection. Tracked for cleanup via testAssets.
81-
*
82-
* @example
83-
* const { id, name } = await createWideTestDatasetForTest(
84-
* page, testAssets, test.info(), { columnCount: 50, prefix: 'wide_perf' }
85-
* );
86-
*/
87-
export async function createWideTestDatasetForTest(
88-
page: Page,
89-
testAssets: TestAssets,
90-
testInfo: TestInfo,
91-
options?: CreateWideTestDatasetOptions,
92-
): Promise<TestDatasetResult> {
93-
const prefix = options?.prefix ?? 'wide_test';
94-
const columnCount = options?.columnCount ?? 50;
95-
const name = `${prefix}_${Date.now()}_${testInfo.parallelIndex}`;
96-
97-
const id = await createWideTestDataset(page, name, columnCount);
98-
if (!id) {
99-
throw new Error(
100-
`Failed to create wide test dataset (${columnCount} cols): ${name}`,
101-
);
102-
}
103-
testAssets.trackDataset(id);
104-
105-
return { id, name };
106-
}

0 commit comments

Comments
 (0)