Skip to content

Commit

Permalink
chore(test): skip tests if image build failed (#676)
Browse files Browse the repository at this point in the history
* chore(test): skip tests if image build failed
  • Loading branch information
cbr7 authored Jul 26, 2024
1 parent 862afe2 commit f3d877d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/playwright/src/bootc-extension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<RunnerTestContext>(async ctx => {
ctx.pdRunner = pdRunner;
Expand Down Expand Up @@ -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();

Expand All @@ -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;
Expand Down

0 comments on commit f3d877d

Please sign in to comment.