From c561a982fbd6ae923c6f2b8e249b63189b1a50a9 Mon Sep 17 00:00:00 2001 From: Asier Isayas Date: Wed, 21 Jan 2026 11:05:55 -0800 Subject: [PATCH] delete database after each test --- test/fx.ts | 16 ++++++++-------- test/sql/document.spec.ts | 4 +--- .../scaleAndSettings/changePartitionKey.spec.ts | 3 --- .../scaleAndSettings/computedProperties.spec.ts | 3 --- test/sql/scaleAndSettings/scale.spec.ts | 4 +--- test/sql/scaleAndSettings/settings.spec.ts | 3 --- test/sql/scripts/storedProcedure.spec.ts | 3 --- test/sql/scripts/trigger.spec.ts | 3 --- test/sql/scripts/userDefinedFunction.spec.ts | 3 --- 9 files changed, 10 insertions(+), 32 deletions(-) diff --git a/test/fx.ts b/test/fx.ts index e5b63c02c..4c8cc2bad 100644 --- a/test/fx.ts +++ b/test/fx.ts @@ -526,14 +526,14 @@ export class DataExplorer { const containerNode = await this.waitForContainerNode(context.database.id, context.container.id); await containerNode.expand(); - // refresh tree to remove deleted database - const consoleMessages = await this.getNotificationConsoleMessages(); - const refreshButton = this.frame.getByTestId("Sidebar/RefreshButton"); - await refreshButton.click(); - await expect(consoleMessages).toContainText("Successfully refreshed databases", { - timeout: ONE_MINUTE_MS, - }); - await this.collapseNotificationConsole(); + // // refresh tree to remove deleted database + // const consoleMessages = await this.getNotificationConsoleMessages(); + // const refreshButton = this.frame.getByTestId("Sidebar/RefreshButton"); + // await refreshButton.click(); + // await expect(consoleMessages).toContainText("Successfully refreshed databases", { + // timeout: ONE_MINUTE_MS, + // }); + // await this.collapseNotificationConsole(); const scaleAndSettingsButton = this.frame.getByTestId( `TreeNode:${context.database.id}/${context.container.id}/Scale & Settings`, diff --git a/test/sql/document.spec.ts b/test/sql/document.spec.ts index 5d17c22c3..a093da376 100644 --- a/test/sql/document.spec.ts +++ b/test/sql/document.spec.ts @@ -136,9 +136,7 @@ test.describe.serial("Upload Item", () => { if (existsSync(uploadDocumentDirPath)) { rmdirSync(uploadDocumentDirPath); } - if (!process.env.CI) { - await context?.dispose(); - } + await context?.dispose(); }); test.afterEach("Close Upload Items panel if still open", async () => { diff --git a/test/sql/scaleAndSettings/changePartitionKey.spec.ts b/test/sql/scaleAndSettings/changePartitionKey.spec.ts index 02858766c..693804b29 100644 --- a/test/sql/scaleAndSettings/changePartitionKey.spec.ts +++ b/test/sql/scaleAndSettings/changePartitionKey.spec.ts @@ -25,12 +25,9 @@ test.describe("Change Partition Key", () => { await PartitionKeyTab.click(); }); - // Delete database only if not running in CI - if (!process.env.CI) { test.afterEach("Delete Test Database", async () => { await context?.dispose(); }); - } test("Change partition key path", async ({ page }) => { await expect(explorer.frame.getByText("/partitionKey")).toBeVisible(); diff --git a/test/sql/scaleAndSettings/computedProperties.spec.ts b/test/sql/scaleAndSettings/computedProperties.spec.ts index ec61ad29d..a164e1ccd 100644 --- a/test/sql/scaleAndSettings/computedProperties.spec.ts +++ b/test/sql/scaleAndSettings/computedProperties.spec.ts @@ -24,12 +24,9 @@ test.describe("Computed Properties", () => { await computedPropertiesTab.click(); }); - // Delete database only if not running in CI - if (!process.env.CI) { test.afterEach("Delete Test Database", async () => { await context?.dispose(); }); - } test("Add valid computed property", async ({ page }) => { await clearComputedPropertiesTextBoxContent({ page }); diff --git a/test/sql/scaleAndSettings/scale.spec.ts b/test/sql/scaleAndSettings/scale.spec.ts index d12db999c..c3dbdb39d 100644 --- a/test/sql/scaleAndSettings/scale.spec.ts +++ b/test/sql/scaleAndSettings/scale.spec.ts @@ -118,7 +118,5 @@ async function openScaleTab(browser: Browser): Promise { } async function cleanup({ context }: Partial) { - if (!process.env.CI) { - await context?.dispose(); - } +await context?.dispose(); } diff --git a/test/sql/scaleAndSettings/settings.spec.ts b/test/sql/scaleAndSettings/settings.spec.ts index 18cd32efb..1b0223ca5 100644 --- a/test/sql/scaleAndSettings/settings.spec.ts +++ b/test/sql/scaleAndSettings/settings.spec.ts @@ -17,12 +17,9 @@ test.describe("Settings under Scale & Settings", () => { await settingsTab.click(); }); - // Delete database only if not running in CI - if (!process.env.CI) { test.afterEach("Delete Test Database", async () => { await context?.dispose(); }); - } test("Update TTL to On (no default)", async () => { const ttlOnNoDefaultRadioButton = explorer.frame.getByRole("radio", { name: "ttl-on-no-default-option" }); diff --git a/test/sql/scripts/storedProcedure.spec.ts b/test/sql/scripts/storedProcedure.spec.ts index eb8bef4e8..78819b4e1 100644 --- a/test/sql/scripts/storedProcedure.spec.ts +++ b/test/sql/scripts/storedProcedure.spec.ts @@ -16,12 +16,9 @@ test.describe("Stored Procedures", () => { explorer = await DataExplorer.open(page, TestAccount.SQL2); }); - // Delete database only if not running in CI - if (!process.env.CI) { test.afterEach("Delete Test Database", async () => { await context?.dispose(); }); - } test("Add, execute, and delete stored procedure", async ({ page }, testInfo) => { void page; diff --git a/test/sql/scripts/trigger.spec.ts b/test/sql/scripts/trigger.spec.ts index f1aa39975..09b26dc56 100644 --- a/test/sql/scripts/trigger.spec.ts +++ b/test/sql/scripts/trigger.spec.ts @@ -28,12 +28,9 @@ test.describe("Triggers", () => { explorer = await DataExplorer.open(page, TestAccount.SQL2); }); - // Delete database only if not running in CI - if (!process.env.CI) { test.afterEach("Delete Test Database", async () => { await context?.dispose(); }); - } test("Add and delete trigger", async ({ page }, testInfo) => { // Open container context menu and click New Trigger diff --git a/test/sql/scripts/userDefinedFunction.spec.ts b/test/sql/scripts/userDefinedFunction.spec.ts index 5f5f0fe93..b17e0fdc4 100644 --- a/test/sql/scripts/userDefinedFunction.spec.ts +++ b/test/sql/scripts/userDefinedFunction.spec.ts @@ -21,12 +21,9 @@ test.describe("User Defined Functions", () => { explorer = await DataExplorer.open(page, TestAccount.SQL2); }); - // Delete database only if not running in CI - if (!process.env.CI) { test.afterEach("Delete Test Database", async () => { await context?.dispose(); }); - } test("Add, execute, and delete user defined function", async ({ page }, testInfo) => { // Open container context menu and click New UDF