dont delete database

This commit is contained in:
Asier Isayas
2026-01-21 06:51:26 -08:00
parent 4270151e97
commit dd93b70a61
8 changed files with 42 additions and 23 deletions

View File

@@ -25,9 +25,12 @@ test.describe("Change Partition Key", () => {
await PartitionKeyTab.click();
});
test.afterEach("Delete Test Database", async () => {
await context?.dispose();
});
// 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();

View File

@@ -24,9 +24,12 @@ test.describe("Computed Properties", () => {
await computedPropertiesTab.click();
});
test.afterAll("Delete Test Database", async () => {
await context?.dispose();
});
// 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 });

View File

@@ -118,5 +118,7 @@ async function openScaleTab(browser: Browser): Promise<SetupResult> {
}
async function cleanup({ context }: Partial<SetupResult>) {
await context?.dispose();
if (!process.env.CI) {
await context?.dispose();
}
}

View File

@@ -17,9 +17,12 @@ test.describe("Settings under Scale & Settings", () => {
await settingsTab.click();
});
test.afterAll("Delete Test Database", async () => {
await context?.dispose();
});
// 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" });

View File

@@ -13,12 +13,15 @@ test.describe("Stored Procedures", () => {
});
test.beforeEach("Open container", async ({ page }) => {
explorer = await DataExplorer.open(page, TestAccount.SQL);
explorer = await DataExplorer.open(page, TestAccount.SQL2);
});
test.afterAll("Delete Test Database", async () => {
await context?.dispose();
});
// 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;

View File

@@ -25,12 +25,15 @@ test.describe("Triggers", () => {
});
test.beforeEach("Open container", async ({ page }) => {
explorer = await DataExplorer.open(page, TestAccount.SQL);
explorer = await DataExplorer.open(page, TestAccount.SQL2);
});
test.afterAll("Delete Test Database", async () => {
await context?.dispose();
});
// 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

View File

@@ -18,12 +18,15 @@ test.describe("User Defined Functions", () => {
});
test.beforeEach("Open container", async ({ page }) => {
explorer = await DataExplorer.open(page, TestAccount.SQL);
explorer = await DataExplorer.open(page, TestAccount.SQL2);
});
test.afterAll("Delete Test Database", async () => {
await context?.dispose();
});
// 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

View File

@@ -159,7 +159,6 @@ export async function createTestSQLContainer({
const adaptedCredentials = new AzureIdentityCredentialAdapter(credentials);
const armClient = new CosmosDBManagementClient(adaptedCredentials, subscriptionId);
const accountName = getAccountName(testAccount);
console.log(accountName);
const account = await armClient.databaseAccounts.get(resourceGroupName, accountName);
const clientOptions: CosmosClientOptions = {