Fix integration test lifecycle fuctions not failing tests (#2259)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-03-30 10:14:59 -04:00
1 parent eec0644667
commit 8eb8fb6234
5 files changed
+59 -22

No files matched your search

+4 -3
View File
@@ -13,7 +13,6 @@ import * as utils from "../helpers/utils";
import { listHelmRepositories } from "../helpers/utils";
import { fail } from "assert";
jest.setTimeout(60000);
// FIXME (!): improve / simplify all css-selectors + use [data-test-id="some-id"] (already used in some tests below)
@@ -21,9 +20,11 @@ describe("Lens integration tests", () => {
let app: Application;
describe("app start", () => {
beforeAll(async () => app = await utils.appStart(), 20000);
utils.beforeAllWrapped(async () => {
app = await utils.appStart();
});
afterAll(async () => {
utils.afterAllWrapped(async () => {
if (app?.isRunning()) {
await utils.tearDown(app);
}
+14 -13
View File
@@ -33,10 +33,12 @@ describe("Lens cluster pages", () => {
};
describe("cluster add", () => {
beforeAll(async () => app = await utils.appStart(), 20000);
utils.beforeAllWrapped(async () => {
app = await utils.appStart();
});
afterAll(async () => {
if (app && app.isRunning()) {
utils.afterAllWrapped(async () => {
if (app?.isRunning()) {
return utils.tearDown(app);
}
});
@@ -64,11 +66,10 @@ describe("Lens cluster pages", () => {
}
describe("cluster pages", () => {
utils.beforeAllWrapped(appStartAddCluster);
beforeAll(appStartAddCluster, 40000);
afterAll(async () => {
if (app && app.isRunning()) {
utils.afterAllWrapped(async () => {
if (app?.isRunning()) {
return utils.tearDown(app);
}
});
@@ -355,10 +356,10 @@ describe("Lens cluster pages", () => {
});
describe("viewing pod logs", () => {
beforeEach(appStartAddCluster, 40000);
utils.beforeEachWrapped(appStartAddCluster);
afterEach(async () => {
if (app && app.isRunning()) {
utils.afterEachWrapped(async () => {
if (app?.isRunning()) {
return utils.tearDown(app);
}
});
@@ -405,10 +406,10 @@ describe("Lens cluster pages", () => {
});
describe("cluster operations", () => {
beforeEach(appStartAddCluster, 40000);
utils.beforeEachWrapped(appStartAddCluster);
afterEach(async () => {
if (app && app.isRunning()) {
utils.afterEachWrapped(async () => {
if (app?.isRunning()) {
return utils.tearDown(app);
}
});
@@ -7,9 +7,11 @@ describe("Lens command palette", () => {
let app: Application;
describe("menu", () => {
beforeAll(async () => app = await utils.appStart(), 20000);
utils.beforeAllWrapped(async () => {
app = await utils.appStart();
});
afterAll(async () => {
utils.afterAllWrapped(async () => {
if (app?.isRunning()) {
await utils.tearDown(app);
}
+4 -4
View File
@@ -13,13 +13,13 @@ describe("Lens integration tests", () => {
const ready = minikubeReady("workspace-int-tests");
utils.describeIf(ready)("workspaces", () => {
beforeAll(async () => {
utils.beforeAllWrapped(async () => {
app = await utils.appStart();
await utils.clickWhatsNew(app);
}, 20000);
});
afterAll(async () => {
if (app && app.isRunning()) {
utils.afterAllWrapped(async () => {
if (app?.isRunning()) {
return utils.tearDown(app);
}
});