This commit is contained in:
Diego Imbert
2026-01-09 12:59:06 +01:00
parent 6d30023a43
commit 3e65b88bb8
2 changed files with 51 additions and 27 deletions
+19 -19
View File
@@ -228,24 +228,24 @@ services:
retries: 5
logging: *default-logging
# minio_e2e:
# image: minio/minio:latest
# restart: unless-stopped
# command: server /data --console-address ":9001"
# expose:
# - 9000
# - 9001
# environment:
# MINIO_ROOT_USER: minioadmin
# MINIO_ROOT_PASSWORD: minioadmin
# volumes:
# - minio_data:/data
# healthcheck:
# test: ["CMD", "mc", "ready", "local"]
# interval: 10s
# timeout: 5s
# retries: 5
# logging: *default-logging
minio_e2e:
image: minio/minio:latest
restart: unless-stopped
command: server /data --console-address ":9001"
expose:
- 9000
- 9001
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 10s
timeout: 5s
retries: 5
logging: *default-logging
volumes:
db_data: null
@@ -256,4 +256,4 @@ volumes:
mssql_data: null
oracle_data: null
postgres_e2e_data: null
# minio_data: null
minio_data: null
@@ -6,11 +6,11 @@ import { Toast, prettify } from './utils'
test.describe('Database resources', () => {
for (const dbType of ['postgresql', 'mysql', 'bigquery', 'ms_sql_server', 'snowflake'] as const) {
test.describe(prettify(dbType), () => {
test(`setup a ${dbType} resource and test simple CRUD with DB Manager`, async ({ page }) => {
test(`simple CRUD with DB Manager`, async ({ page }) => {
await setupNewResourceAndOpenDbManager(page, dbType)
await runDbManagerSimpleCRUDTest(page, dbType)
})
test(`setup a ${dbType} resource and test Alter table with DB Manager`, async ({ page }) => {
test(`Alter table with DB Manager`, async ({ page }) => {
await setupNewResourceAndOpenDbManager(page, dbType)
await runDbManagerAlterTableTest(page, dbType)
})
@@ -29,6 +29,30 @@ test.describe('Data tables', () => {
})
})
test.describe('Ducklake', () => {
test('simple CRUD with DB Manager', async ({ page }) => {
await openDucklakeDbManager(page)
await runDbManagerSimpleCRUDTest(page, 'ducklake')
})
test('Alter table with DB Manager', async ({ page }) => {
await openDucklakeDbManager(page)
await runDbManagerAlterTableTest(page, 'ducklake')
})
})
async function openDucklakeDbManager(page: Page) {
// await page.goto('/workspace_settings?tab=windmill_lfs')]
// // Check if ducklake already exists
// let table = page.locator('table')
// await table.waitFor({ state: 'visible' })
// let rows = await table.locator('tr:has(input[id="name"])').all()
// for (const row of rows) {
// const val = await row.locator('input[id="name"]').inputValue()
// // Don't setup again if it already exists (saving the settings creates race condition)
// if (val === datatableId) return
// }
}
async function openDataTableDbManager(page: Page) {
await page.goto('/workspace_settings?tab=windmill_data_tables')
await setupNewDataTable(page, `datatable_${process.env.TEST_UNIQUE_ID}`)
@@ -55,9 +79,7 @@ async function setupNewDataTable(page: Page, datatableId: string) {
let rows = await table.locator('tr:has(input[id="name"])').all()
for (const row of rows) {
const val = await row.locator('input[id="name"]').inputValue()
// Don't setup again if it already exists.
// The reason we do not use a unique datatable per test is that saving
// the settings create a race condition when multiple tests run in parallel.
// Don't setup again if it already exists (saving the settings creates race condition)
if (val === datatableId) return
}
@@ -161,13 +183,15 @@ async function setupNewResource(
page: Page,
resourceType: DbType
): Promise<{ resourceName: string }> {
// Generate unique ID with timestamp
const resourceName = `${resourceType}_${Date.now()}`
const resourceName = `${resourceType}_e2e}`
await page.goto('/resources')
await page.locator('table').waitFor({ state: 'visible' })
if (await page.locator(`table tr:has-text("${resourceName}")`).isVisible())
return { resourceName }
const newDataTableButton = page.locator('button:text-is("Add resource")')
await newDataTableButton.waitFor({ state: 'visible' })
await newDataTableButton.click()
const addResourceDrawer = page.locator('#add-resource-drawer')