Skip to content

Commit 9054acd

Browse files
authored
chore(test): add error handling and extend extension verification timeout (#584)
1 parent 752d50a commit 9054acd

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

tests/playwright/src/spec/minikube-extension.spec.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const CONTAINER_START_PARAMS: ContainerInteractiveParams = {
6262
let extensionsPage: ExtensionsPage;
6363
let minikubeResourceCard: ResourceConnectionCardPage;
6464

65+
const isGHActions = process.env.GITHUB_ACTIONS === 'true';
6566
const skipExtensionInstallation = process.env.SKIP_EXTENSION_INSTALL === 'true';
6667
const driverGHA = process.env.MINIKUBE_DRIVER_GHA ?? '';
6768

@@ -87,7 +88,7 @@ test.afterAll(async ({ page, runner }) => {
8788
await deleteCluster(page, EXTENSION_NAME, MINIKUBE_CONTAINER, CLUSTER_NAME);
8889
}
8990
finally {
90-
execSync(`pkill minikube`, {stdio: 'inherit'});
91+
await terminateMinikube();
9192
await runner.close();
9293
}
9394
});
@@ -104,9 +105,11 @@ test.describe.serial('Podman Desktop Minikube Extension Tests', () => {
104105
});
105106

106107
test('Verify Minikube extension is installed and active', async ({ navigationBar }) => {
108+
test.setTimeout(60_000);
109+
107110
await navigationBar.openExtensions();
108111
await playExpect(extensionsPage.header).toBeVisible();
109-
await playExpect.poll(async () => extensionsPage.extensionIsInstalled(EXTENSION_LABEL)).toBeTruthy();
112+
await playExpect.poll(async () => extensionsPage.extensionIsInstalled(EXTENSION_LABEL), {timeout: 60_000}).toBeTruthy();
110113
const minikubeExtension = await extensionsPage.getInstalledExtension(EXTENSION_NAME, EXTENSION_LABEL);
111114
await playExpect(minikubeExtension.status).toHaveText('ACTIVE', { timeout: 40_000 });
112115
});
@@ -255,4 +258,15 @@ test.describe.serial('Podman Desktop Minikube Extension Tests', () => {
255258
});
256259
});
257260

261+
async function terminateMinikube(): Promise<void> {
262+
if(isGHActions && isLinux) {
263+
try{
264+
// eslint-disable-next-line
265+
execSync('pkill -o minikube');
266+
} catch (error: unknown) {
267+
console.log(`Error while killing the minikube: ${error}`);
268+
}
269+
}
270+
}
271+
258272

0 commit comments

Comments
 (0)