Skip to content

Commit f3d877d

Browse files
authored
chore(test): skip tests if image build failed (#676)
* chore(test): skip tests if image build failed
1 parent 862afe2 commit f3d877d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const contextDirectory = path.resolve(__dirname, '..', 'resources');
5050
const skipInstallation = process.env.SKIP_INSTALLATION;
5151
const buildISOImage = process.env.BUILD_ISO_IMAGE;
5252
let timeoutForBuild = 600000;
53+
let imageBuildFailed = true;
5354

5455
beforeEach<RunnerTestContext>(async ctx => {
5556
ctx.pdRunner = pdRunner;
@@ -110,6 +111,7 @@ describe('BootC Extension', async () => {
110111
'Bootc images for architecture: %s',
111112
async architecture => {
112113
test('Build bootc image from containerfile', async () => {
114+
imageBuildFailed = true;
113115
let imagesPage = await navBar.openImages();
114116
await playExpect(imagesPage.heading).toBeVisible();
115117

@@ -121,13 +123,20 @@ describe('BootC Extension', async () => {
121123
containerFilePath,
122124
contextDirectory,
123125
architecture,
126+
180000,
124127
);
125128

126129
await playExpect.poll(async () => await imagesPage.waitForImageExists(imageName)).toBeTruthy();
127-
}, 150000);
130+
imageBuildFailed = false;
131+
}, 210000);
128132

129133
describe.skipIf(isLinux).each(['QCOW2', 'AMI', 'RAW', 'VMDK', 'ISO'])('Building images ', async type => {
130134
test(`Building bootable image type: ${type}`, async context => {
135+
if (imageBuildFailed) {
136+
console.log('Image build failed, skipping test');
137+
context.skip();
138+
}
139+
131140
if (type === 'ISO') {
132141
if (buildISOImage) {
133142
timeoutForBuild = 1200000;

0 commit comments

Comments
 (0)