Skip to content

Commit 88ec128

Browse files
chore(tests): hotfix test order (#3612)
Signed-off-by: Tibor Dancs <[email protected]> Co-authored-by: George Serban <[email protected]>
1 parent 16330bb commit 88ec128

File tree

1 file changed

+67
-67
lines changed

1 file changed

+67
-67
lines changed

tests/playwright/src/ai-lab-extension.spec.ts

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -613,80 +613,80 @@ test.describe.serial(`AI Lab extension installation and verification`, () => {
613613
await playExpect(instructLabPage.startInstructLabButton).toBeEnabled();
614614
});
615615
});
616-
});
617-
618-
test.describe.serial(`Start Llama Stack from sidebar and verify containers`, { tag: '@smoke' }, () => {
619-
test.skip(!!isCI && !!isWindows, 'Skipping Llama Stack tests on GitHub Actions with Windows platform');
620-
let llamaStackPage: AiLlamaStackPage;
621-
const llamaStackContainerNames: string[] = [];
622-
623-
test.beforeAll(`Open Llama Stack`, async ({ runner, page, navigationBar }) => {
624-
aiLabPage = await reopenAILabDashboard(runner, page, navigationBar);
625-
await aiLabPage.navigationBar.waitForLoad();
626-
llamaStackPage = await aiLabPage.navigationBar.openLlamaStack();
627-
await llamaStackPage.waitForLoad();
628-
});
629616

630-
test(`Start Llama Stack containers`, async () => {
631-
test.setTimeout(300_000);
632-
await llamaStackPage.waitForLoad();
633-
await llamaStackPage.runLlamaStackContainer();
634-
await playExpect(llamaStackPage.openLlamaStackContainerButton).toBeVisible({ timeout: 120_000 });
635-
await playExpect(llamaStackPage.exploreLlamaStackEnvironmentButton).toBeVisible({ timeout: 120_000 });
636-
await playExpect(llamaStackPage.openLlamaStackContainerButton).toBeEnabled({ timeout: 30_000 });
637-
await playExpect(llamaStackPage.exploreLlamaStackEnvironmentButton).toBeEnabled({ timeout: 30_000 });
638-
});
617+
test.describe.serial(`Start Llama Stack from sidebar and verify containers`, { tag: '@smoke' }, () => {
618+
test.skip(!!isCI && !!isWindows, 'Skipping Llama Stack tests on GitHub Actions with Windows platform');
619+
let llamaStackPage: AiLlamaStackPage;
620+
const llamaStackContainerNames: string[] = [];
639621

640-
test(`Verify Llama Stack containers are running`, async ({ navigationBar }) => {
641-
let containersPage = await navigationBar.openContainers();
642-
await playExpect(containersPage.heading).toBeVisible();
643-
644-
await playExpect
645-
.poll(
646-
async () => {
647-
const allRows = await containersPage.getAllTableRows();
648-
llamaStackContainerNames.length = 0;
649-
for (const row of allRows) {
650-
const text = await row.textContent();
651-
if (text?.includes('llama-stack')) {
652-
const containerNameMatch = RegExp(/\b(llama-stack[^\s]*)/).exec(text);
653-
if (containerNameMatch) {
654-
llamaStackContainerNames.push(containerNameMatch[1]);
655-
}
656-
}
657-
}
658-
return llamaStackContainerNames.length;
659-
},
660-
{
661-
timeout: 30_000,
662-
intervals: [5_000],
663-
},
664-
)
665-
.toBe(2);
622+
test.beforeAll(`Open Llama Stack`, async ({ runner, page, navigationBar }) => {
623+
aiLabPage = await reopenAILabDashboard(runner, page, navigationBar);
624+
await aiLabPage.navigationBar.waitForLoad();
625+
llamaStackPage = await aiLabPage.navigationBar.openLlamaStack();
626+
await llamaStackPage.waitForLoad();
627+
});
666628

667-
console.log(`Found containers: ${llamaStackContainerNames.join(', ')}`);
629+
test(`Start Llama Stack containers`, async () => {
630+
test.setTimeout(300_000);
631+
await llamaStackPage.waitForLoad();
632+
await llamaStackPage.runLlamaStackContainer();
633+
await playExpect(llamaStackPage.openLlamaStackContainerButton).toBeVisible({ timeout: 120_000 });
634+
await playExpect(llamaStackPage.exploreLlamaStackEnvironmentButton).toBeVisible({ timeout: 120_000 });
635+
await playExpect(llamaStackPage.openLlamaStackContainerButton).toBeEnabled({ timeout: 30_000 });
636+
await playExpect(llamaStackPage.exploreLlamaStackEnvironmentButton).toBeEnabled({ timeout: 30_000 });
637+
});
668638

669-
for (const container of llamaStackContainerNames) {
670-
containersPage = await navigationBar.openContainers();
639+
test(`Verify Llama Stack containers are running`, async ({ navigationBar }) => {
640+
let containersPage = await navigationBar.openContainers();
671641
await playExpect(containersPage.heading).toBeVisible();
672-
const containersDetailsPage = await containersPage.openContainersDetails(container);
673-
await playExpect(containersDetailsPage.heading).toBeVisible();
674-
await playExpect
675-
.poll(async () => containersDetailsPage.getState(), { timeout: 30_000 })
676-
.toContain(ContainerState.Running);
677-
}
678-
});
679642

680-
test.afterAll(`Stop Llama Stack containers`, async ({ navigationBar }) => {
681-
for (const container of llamaStackContainerNames) {
682-
const containersPage = await navigationBar.openContainers();
683-
await playExpect(containersPage.heading).toBeVisible();
684-
await containersPage.deleteContainer(container);
685643
await playExpect
686-
.poll(async () => await containersPage.containerExists(container), { timeout: 30_000 })
687-
.toBeFalsy();
688-
}
689-
await deleteUnusedImages(navigationBar);
644+
.poll(
645+
async () => {
646+
const allRows = await containersPage.getAllTableRows();
647+
llamaStackContainerNames.length = 0;
648+
for (const row of allRows) {
649+
const text = await row.textContent();
650+
if (text?.includes('llama-stack')) {
651+
const containerNameMatch = RegExp(/\b(llama-stack[^\s]*)/).exec(text);
652+
if (containerNameMatch) {
653+
llamaStackContainerNames.push(containerNameMatch[1]);
654+
}
655+
}
656+
}
657+
return llamaStackContainerNames.length;
658+
},
659+
{
660+
timeout: 30_000,
661+
intervals: [5_000],
662+
},
663+
)
664+
.toBe(2);
665+
666+
console.log(`Found containers: ${llamaStackContainerNames.join(', ')}`);
667+
668+
for (const container of llamaStackContainerNames) {
669+
containersPage = await navigationBar.openContainers();
670+
await playExpect(containersPage.heading).toBeVisible();
671+
const containersDetailsPage = await containersPage.openContainersDetails(container);
672+
await playExpect(containersDetailsPage.heading).toBeVisible();
673+
await playExpect
674+
.poll(async () => containersDetailsPage.getState(), { timeout: 30_000 })
675+
.toContain(ContainerState.Running);
676+
}
677+
});
678+
679+
test.afterAll(`Stop Llama Stack containers`, async ({ navigationBar }) => {
680+
for (const container of llamaStackContainerNames) {
681+
const containersPage = await navigationBar.openContainers();
682+
await playExpect(containersPage.heading).toBeVisible();
683+
await containersPage.deleteContainer(container);
684+
await playExpect
685+
.poll(async () => await containersPage.containerExists(container), { timeout: 30_000 })
686+
.toBeFalsy();
687+
}
688+
await deleteUnusedImages(navigationBar);
689+
});
690690
});
691691
});
692692

0 commit comments

Comments
 (0)