Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(test): skip tests if image build failed #676

Merged
merged 3 commits into from
Jul 26, 2024
Merged
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: 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