From f3d877dba35b9f48782105e2f470d0b830eeefd1 Mon Sep 17 00:00:00 2001 From: Vladimir Lazar <106525396+cbr7@users.noreply.github.com> Date: Fri, 26 Jul 2024 14:39:33 +0200 Subject: [PATCH] chore(test): skip tests if image build failed (#676) * chore(test): skip tests if image build failed --- tests/playwright/src/bootc-extension.spec.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/playwright/src/bootc-extension.spec.ts b/tests/playwright/src/bootc-extension.spec.ts index 1f9345ea..0c694121 100644 --- a/tests/playwright/src/bootc-extension.spec.ts +++ b/tests/playwright/src/bootc-extension.spec.ts @@ -50,6 +50,7 @@ const contextDirectory = path.resolve(__dirname, '..', 'resources'); const skipInstallation = process.env.SKIP_INSTALLATION; const buildISOImage = process.env.BUILD_ISO_IMAGE; let timeoutForBuild = 600000; +let imageBuildFailed = true; beforeEach(async ctx => { ctx.pdRunner = pdRunner; @@ -110,6 +111,7 @@ describe('BootC Extension', async () => { 'Bootc images for architecture: %s', async architecture => { test('Build bootc image from containerfile', async () => { + imageBuildFailed = true; let imagesPage = await navBar.openImages(); await playExpect(imagesPage.heading).toBeVisible(); @@ -121,13 +123,20 @@ describe('BootC Extension', async () => { containerFilePath, contextDirectory, architecture, + 180000, ); await playExpect.poll(async () => await imagesPage.waitForImageExists(imageName)).toBeTruthy(); - }, 150000); + imageBuildFailed = false; + }, 210000); describe.skipIf(isLinux).each(['QCOW2', 'AMI', 'RAW', 'VMDK', 'ISO'])('Building images ', async type => { test(`Building bootable image type: ${type}`, async context => { + if (imageBuildFailed) { + console.log('Image build failed, skipping test'); + context.skip(); + } + if (type === 'ISO') { if (buildISOImage) { timeoutForBuild = 1200000;