Skip to content

Commit

Permalink
feat: further stabilize e2e test by removing the clean up function (#356
Browse files Browse the repository at this point in the history
)

Because

- Console is the last to test in make file and we test console
separately in CI so we don't need to clean up the resource after test

This commit

- further stabilize e2e test by removing the clean up function
  • Loading branch information
EiffelFly committed Feb 21, 2023
1 parent e1ed5a8 commit eb0e58c
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 82 deletions.
4 changes: 0 additions & 4 deletions integration-test/destination-async.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ test.use({
},
});

test.afterAll(async () => {
await deleteDestination(destinationId);
});

test.describe.serial("Async destination", () => {
test("should warn wrong resource ID", async ({ page }) => {
await page.goto("/destinations/create");
Expand Down
12 changes: 5 additions & 7 deletions integration-test/destination-sync.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ const destinationType = "HTTP";

// If there has a destination-http connector, we need to delete it then proceed the test.
test.beforeAll(async () => {
await deleteDestination(destinationId);
});

// Delete used sync destination connector to avoid conflict or casuing other
// test to fall.
test.afterAll(async () => {
await deleteDestination(destinationId);
try {
await deleteDestination(destinationId);
} catch (err) {
return Promise.reject(err);
}
});

test.describe.serial("Sync destination", () => {
Expand Down
10 changes: 5 additions & 5 deletions integration-test/model-artivc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ test.describe.serial("Artivc model", () => {

// Disable test related to long-running operation

test.skip("should have proper delete model modal and delete this model", async ({
page,
}) => {
await expectToDeleteModel(page, modelId);
});
// test.skip("should have proper delete model modal and delete this model", async ({
// page,
// }) => {
// await expectToDeleteModel(page, modelId);
// });
});
10 changes: 5 additions & 5 deletions integration-test/model-github.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ test.describe.serial("GitHub model", () => {

// Disable test related to long-running operation

test.skip("should have proper delete model modal and delete this model", async ({
page,
}) => {
await expectToDeleteModel(page, modelId);
});
// test.skip("should have proper delete model modal and delete this model", async ({
// page,
// }) => {
// await expectToDeleteModel(page, modelId);
// });
});
10 changes: 5 additions & 5 deletions integration-test/model-huggingface.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ test.describe.serial("Hugging face model", () => {

// Disable test related to long-running operation

test.skip("should have proper delete model modal and delete this model", async ({
page,
}) => {
await expectToDeleteModel(page, modelId);
});
// test.skip("should have proper delete model modal and delete this model", async ({
// page,
// }) => {
// await expectToDeleteModel(page, modelId);
// });
});
10 changes: 5 additions & 5 deletions integration-test/model-local.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ test.describe.serial("Local model", () => {

// Disable test related to long-running operation

test.skip("should have proper delete model modal and delete this model", async ({
page,
}) => {
await expectToDeleteModel(page, modelId);
});
// test.skip("should have proper delete model modal and delete this model", async ({
// page,
// }) => {
// await expectToDeleteModel(page, modelId);
// });
});
31 changes: 1 addition & 30 deletions integration-test/pipeline-async.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,35 +34,8 @@ test.use({
},
});

test.afterAll(async () => {
try {
// We need to clean up destination and source too
await deleteDestination("destination-http");
await deleteSource("source-http");
await deleteModel(modelId);
} catch (err) {
console.log(err);
}
});

test.describe
.serial("Async pipeline with new source, destination and local model", () => {
test.afterAll(async () => {
try {
const client = createInstillAxiosTestClient();

await client.post(
`${env(
"NEXT_PUBLIC_API_VERSION"
)}/models/${modelId}/instances/${modelInstanceTag}/undeploy`
);
await deleteDestination(destinationId);
await deleteSource("source-http");
} catch (err) {
return Promise.reject(err);
}
});

test("should create async pipeline", async ({ page }) => {
await page.goto("/pipelines/create", { waitUntil: "networkidle" });

Expand Down Expand Up @@ -220,9 +193,7 @@ test.describe
await expectToUpdatePipelineDescription(page, pipelineId, "");
});

// Disable test related to long-running operation

test.skip("should have proper delete pipeline modal and delete this pipeline", async ({
test("should have proper delete pipeline modal and delete this pipeline", async ({
page,
}) => {
await expectToDeletePipeline(page, pipelineId);
Expand Down
15 changes: 1 addition & 14 deletions integration-test/pipeline-sync.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,6 @@ test.use({
},
});

test.afterAll(async () => {
try {
// We need to clean up destination and source too
await deleteDestination("destination-http");
await deleteSource("source-http");
await deleteModel(modelId);
} catch (err) {
console.log(err);
}
});

test.describe
.serial("Sync pipeline with new source, destination and local model", () => {
test("should create sync pipeline", async ({ page }) => {
Expand Down Expand Up @@ -193,9 +182,7 @@ test.describe
await expectToUpdatePipelineDescription(page, pipelineId, "");
});

// Disable test related to long-running operation

test.skip("should have proper delete pipeline modal and delete this pipeline", async ({
test("should have proper delete pipeline modal and delete this pipeline", async ({
page,
}) => {
await expectToDeletePipeline(page, pipelineId);
Expand Down
7 changes: 1 addition & 6 deletions integration-test/source.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { env , deleteSource, expectToSelectReactSelectOption } from "./helper";
import { env, deleteSource, expectToSelectReactSelectOption } from "./helper";
import { test, expect } from "@playwright/test";

const sourceId = "source-grpc";
Expand All @@ -12,11 +12,6 @@ test.beforeAll(async () => {
}
});

// We need to clean up source after the test too.
test.afterAll(async () => {
await deleteSource(sourceId);
});

test.describe.serial("Sync source", () => {
test("should create source", async ({ page }) => {
await page.goto("/sources/create", { waitUntil: "networkidle" });
Expand Down
1 change: 0 additions & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ if (!process.env.NEXT_PUBLIC_CONSOLE_BASE_URL) {
const config: PlaywrightTestConfig = {
testDir: "./integration-test",
globalSetup: require.resolve("./integration-test/helper/global-setup"),
globalTeardown: require.resolve("./integration-test/helper/global-teardown"),
/* Maximum time one test can run for. */
timeout: 30000,
expect: {
Expand Down

0 comments on commit eb0e58c

Please sign in to comment.