Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:
- uses: actions/setup-node@v5
with:
node-version: 22

# Checkout podman desktop
- uses: actions/checkout@v5
with:
Expand Down Expand Up @@ -159,6 +160,16 @@ jobs:
podman rm -f $CONTAINER_ID
podman rmi -f localhost/local_ai_lab_image:latest

# Show disk space before cleanup
- name: Show disk space before cleanup
run: df -h
# Minimal disk cleanup after install/build
- name: Free up disk space
run: |
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/* /usr/share/dotnet /usr/local/lib/android /opt/ghc /usr/local/share/boost /usr/local/share/powershell /usr/local/share/chromium /usr/local/share/edge /usr/local/share/firefox /usr/local/share/google
df -h

- name: Run E2E Smoke tests
working-directory: ./podman-desktop-extension-ai-lab
env:
Expand Down
21 changes: 13 additions & 8 deletions tests/playwright/src/ai-lab-extension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,11 @@ test.describe.serial(`AI Lab extension installation and verification`, () => {
.toBeFalsy();
});

test.afterAll(`Cleaning up service model`, async () => {
test.setTimeout(60_000);
test.afterAll(`Cleaning up service model`, async ({ navigationBar }) => {
test.setTimeout(120_000);
await cleanupServices();
await deleteAllModels();
await deleteUnusedImages(navigationBar);
});
});
});
Expand Down Expand Up @@ -533,7 +534,7 @@ test.describe.serial(`AI Lab extension installation and verification`, () => {
});

test(`${appName}: Restart, Stop, Delete.`, async () => {
test.setTimeout(150_000);
test.setTimeout(240_000);
test.skip(
appName === 'Object Detection' && isCI && !isMac,
'Currently we are facing issues with the Object Detection app installation on Windows and Linux CI.',
Expand All @@ -547,7 +548,7 @@ test.describe.serial(`AI Lab extension installation and verification`, () => {
});

test(`Ensure cleanup of "${appModel}", related services, and images`, async ({ runner, page, navigationBar }) => {
test.setTimeout(150_000);
test.setTimeout(180_000);
aiLabPage = await reopenAILabDashboard(runner, page, navigationBar);
await cleanupServices();
await deleteAllModels();
Expand Down Expand Up @@ -758,11 +759,15 @@ async function stopAndDeleteApp(appName: string): Promise<void> {
}

async function deleteUnusedImages(navigationBar: NavigationBar): Promise<void> {
const imagesPage = await navigationBar.openImages();
await playExpect(imagesPage.heading).toBeVisible();
try {
const imagesPage = await navigationBar.openImages();
await playExpect(imagesPage.heading).toBeVisible();

await imagesPage.deleteAllUnusedImages();
await playExpect.poll(async () => await imagesPage.getCountOfImagesByStatus('UNUSED'), { timeout: 60_000 }).toBe(0);
await imagesPage.deleteAllUnusedImages();
await playExpect.poll(async () => await imagesPage.getCountOfImagesByStatus('UNUSED'), { timeout: 90_000 }).toBe(0);
} catch (error) {
console.error('Error during deleteUnusedImages:', error);
}
}

async function waitForCatalogModel(modelName: string): Promise<boolean> {
Expand Down
27 changes: 19 additions & 8 deletions tests/playwright/src/model/ai-lab-catalog-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,27 @@ export class AILabCatalogPage extends AILabBasePage {
}

async deleteAllModels(): Promise<void> {
const modelRows = await this.getAllModelRows();
if (modelRows.length === 0) {
return;
}
try {
const modelRows = await this.getAllModelRows();
if (modelRows.length === 0) {
return;
}

for (const modelRow of modelRows) {
const modelName = await this.getModelNameByRow(modelRow);
if (await this.isModelDownloaded(modelName)) {
await this.deleteModel(modelName);
for (const modelRow of modelRows) {
const modelName = await this.getModelNameByRow(modelRow);
if (await this.isModelDownloaded(modelName)) {
await this.deleteModel(modelName);
}
}

await playExpect.poll(async () => (await this.getAllModelRows()).length === 0, { timeout: 60_000 }).toBeTruthy();
} catch (error) {
const remainingModels = await this.getAllModelRows();
const remainingModelNames = [];
for (const modelRow of remainingModels) {
remainingModelNames.push(await this.getModelNameByRow(modelRow));
}
console.error('Error during deleteAllModels:', error, 'Remaining models:', remainingModelNames);
}
}

Expand Down
34 changes: 29 additions & 5 deletions tests/playwright/src/model/ai-lab-model-service-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,37 @@ export class AiModelServicePage extends AILabBasePage {
}

async deleteAllCurrentModels(): Promise<void> {
if (!(await this.toggleAllCheckbox.count())) return;
try {
if (!(await this.toggleAllCheckbox.count())) return;

await this.checkAllModelsForDeletion();
await playExpect(this.deleteSelectedItems).toBeEnabled();
await this.deleteSelectedItems.click();
await this.checkAllModelsForDeletion();
await playExpect(this.deleteSelectedItems).toBeEnabled();
await this.deleteSelectedItems.click();

await handleConfirmationDialog(this.page, podmanAILabExtension.extensionName, true, 'Confirm');
await handleConfirmationDialog(this.page, podmanAILabExtension.extensionName, true, 'Confirm');

await playExpect.poll(async () => (await this.getCurrentModelCount()) === 0, { timeout: 60_000 }).toBeTruthy();
} catch (error) {
const remainingRows = await this.getAllTableRows();
const remainingNames: string[] = [];
for (let rowNum = 1; rowNum < remainingRows.length; rowNum++) {
const serviceModel = remainingRows[rowNum].getByRole('cell').nth(4);
const modelName = await serviceModel.textContent();
if (modelName) {
remainingNames.push(modelName);
}
}
console.group('Model Service Cleanup');
console.log(`[${new Date().toISOString()}] Model service deletion failed.`);
if (remainingNames.length > 0) {
console.log('Could not delete:');
remainingNames.forEach(name => console.log(` - ${name}`));
} else {
console.log('All model services deleted successfully.');
}
console.error('Error details:', error);
console.groupEnd();
}
}

async getCurrentModelCount(): Promise<number> {
Expand Down
Loading