From c39845274e7b4e769dc5620bf8738a0dfb7967ae Mon Sep 17 00:00:00 2001 From: Tibor Dancs Date: Tue, 23 Sep 2025 14:52:37 +0200 Subject: [PATCH] chore(tests): hotfix test order Signed-off-by: Tibor Dancs --- tests/playwright/src/ai-lab-extension.spec.ts | 134 +++++++++--------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/tests/playwright/src/ai-lab-extension.spec.ts b/tests/playwright/src/ai-lab-extension.spec.ts index 08d4ca970..0957bf5f1 100644 --- a/tests/playwright/src/ai-lab-extension.spec.ts +++ b/tests/playwright/src/ai-lab-extension.spec.ts @@ -617,80 +617,80 @@ test.describe.serial(`AI Lab extension installation and verification`, () => { await playExpect(instructLabPage.startInstructLabButton).toBeEnabled(); }); }); -}); - -test.describe.serial(`Start Llama Stack from sidebar and verify containers`, { tag: '@smoke' }, () => { - test.skip(!!isCI && !!isWindows, 'Skipping Llama Stack tests on GitHub Actions with Windows platform'); - let llamaStackPage: AiLlamaStackPage; - const llamaStackContainerNames: string[] = []; - - test.beforeAll(`Open Llama Stack`, async ({ runner, page, navigationBar }) => { - aiLabPage = await reopenAILabDashboard(runner, page, navigationBar); - await aiLabPage.navigationBar.waitForLoad(); - llamaStackPage = await aiLabPage.navigationBar.openLlamaStack(); - await llamaStackPage.waitForLoad(); - }); - test(`Start Llama Stack containers`, async () => { - test.setTimeout(300_000); - await llamaStackPage.waitForLoad(); - await llamaStackPage.runLlamaStackContainer(); - await playExpect(llamaStackPage.openLlamaStackContainerButton).toBeVisible({ timeout: 120_000 }); - await playExpect(llamaStackPage.exploreLlamaStackEnvironmentButton).toBeVisible({ timeout: 120_000 }); - await playExpect(llamaStackPage.openLlamaStackContainerButton).toBeEnabled({ timeout: 30_000 }); - await playExpect(llamaStackPage.exploreLlamaStackEnvironmentButton).toBeEnabled({ timeout: 30_000 }); - }); + test.describe.serial(`Start Llama Stack from sidebar and verify containers`, { tag: '@smoke' }, () => { + test.skip(!!isCI && !!isWindows, 'Skipping Llama Stack tests on GitHub Actions with Windows platform'); + let llamaStackPage: AiLlamaStackPage; + const llamaStackContainerNames: string[] = []; - test(`Verify Llama Stack containers are running`, async ({ navigationBar }) => { - let containersPage = await navigationBar.openContainers(); - await playExpect(containersPage.heading).toBeVisible(); - - await playExpect - .poll( - async () => { - const allRows = await containersPage.getAllTableRows(); - llamaStackContainerNames.length = 0; - for (const row of allRows) { - const text = await row.textContent(); - if (text?.includes('llama-stack')) { - const containerNameMatch = RegExp(/\b(llama-stack[^\s]*)/).exec(text); - if (containerNameMatch) { - llamaStackContainerNames.push(containerNameMatch[1]); - } - } - } - return llamaStackContainerNames.length; - }, - { - timeout: 30_000, - intervals: [5_000], - }, - ) - .toBe(2); + test.beforeAll(`Open Llama Stack`, async ({ runner, page, navigationBar }) => { + aiLabPage = await reopenAILabDashboard(runner, page, navigationBar); + await aiLabPage.navigationBar.waitForLoad(); + llamaStackPage = await aiLabPage.navigationBar.openLlamaStack(); + await llamaStackPage.waitForLoad(); + }); - console.log(`Found containers: ${llamaStackContainerNames.join(', ')}`); + test(`Start Llama Stack containers`, async () => { + test.setTimeout(300_000); + await llamaStackPage.waitForLoad(); + await llamaStackPage.runLlamaStackContainer(); + await playExpect(llamaStackPage.openLlamaStackContainerButton).toBeVisible({ timeout: 120_000 }); + await playExpect(llamaStackPage.exploreLlamaStackEnvironmentButton).toBeVisible({ timeout: 120_000 }); + await playExpect(llamaStackPage.openLlamaStackContainerButton).toBeEnabled({ timeout: 30_000 }); + await playExpect(llamaStackPage.exploreLlamaStackEnvironmentButton).toBeEnabled({ timeout: 30_000 }); + }); - for (const container of llamaStackContainerNames) { - containersPage = await navigationBar.openContainers(); + test(`Verify Llama Stack containers are running`, async ({ navigationBar }) => { + let containersPage = await navigationBar.openContainers(); await playExpect(containersPage.heading).toBeVisible(); - const containersDetailsPage = await containersPage.openContainersDetails(container); - await playExpect(containersDetailsPage.heading).toBeVisible(); - await playExpect - .poll(async () => containersDetailsPage.getState(), { timeout: 30_000 }) - .toContain(ContainerState.Running); - } - }); - test.afterAll(`Stop Llama Stack containers`, async ({ navigationBar }) => { - for (const container of llamaStackContainerNames) { - const containersPage = await navigationBar.openContainers(); - await playExpect(containersPage.heading).toBeVisible(); - await containersPage.deleteContainer(container); await playExpect - .poll(async () => await containersPage.containerExists(container), { timeout: 30_000 }) - .toBeFalsy(); - } - await deleteUnusedImages(navigationBar); + .poll( + async () => { + const allRows = await containersPage.getAllTableRows(); + llamaStackContainerNames.length = 0; + for (const row of allRows) { + const text = await row.textContent(); + if (text?.includes('llama-stack')) { + const containerNameMatch = RegExp(/\b(llama-stack[^\s]*)/).exec(text); + if (containerNameMatch) { + llamaStackContainerNames.push(containerNameMatch[1]); + } + } + } + return llamaStackContainerNames.length; + }, + { + timeout: 30_000, + intervals: [5_000], + }, + ) + .toBe(2); + + console.log(`Found containers: ${llamaStackContainerNames.join(', ')}`); + + for (const container of llamaStackContainerNames) { + containersPage = await navigationBar.openContainers(); + await playExpect(containersPage.heading).toBeVisible(); + const containersDetailsPage = await containersPage.openContainersDetails(container); + await playExpect(containersDetailsPage.heading).toBeVisible(); + await playExpect + .poll(async () => containersDetailsPage.getState(), { timeout: 30_000 }) + .toContain(ContainerState.Running); + } + }); + + test.afterAll(`Stop Llama Stack containers`, async ({ navigationBar }) => { + for (const container of llamaStackContainerNames) { + const containersPage = await navigationBar.openContainers(); + await playExpect(containersPage.heading).toBeVisible(); + await containersPage.deleteContainer(container); + await playExpect + .poll(async () => await containersPage.containerExists(container), { timeout: 30_000 }) + .toBeFalsy(); + } + await deleteUnusedImages(navigationBar); + }); }); });