From f28be7c4bfdcb05f731431c71dbe4a1c8c01a1f3 Mon Sep 17 00:00:00 2001 From: EiffelFly <57251712+EiffelFly@users.noreply.github.com> Date: Tue, 21 Feb 2023 20:17:45 +0800 Subject: [PATCH] feat: turn off test related to long running operation (#354) Because - #353 This commit - turn off test related to long running operation --- README.md | 17 ++++++++++++++- integration-test/common/model.ts | 34 ++++++++++++++--------------- integration-test/common/pipeline.ts | 32 ++++++++++++++------------- package.json | 2 +- 4 files changed, 51 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 52147ee05..502f7c5b1 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ We maintain another container `Dockerfile.playwright` specifically for test usag - In console folder: `pnpm dev` - In console folder: `pnpm integration-test` - If you want to test in the docker-container (Run the app with VDP) - - In VDP folder: `make dev PROFILE=all ITMODE=true` + - In VDP folder: `make dev PROFILE=all ITMODE=true CONSOLE_BASE_URL_HOST=console CONSOLE_BASE_API_GATEWAY_URL_HOST=api-gateway` - In console folder: `pnpm docker-build-test` - In console folder: `pnpm docker-run-test` @@ -131,6 +131,21 @@ We maintain another container `Dockerfile.playwright` specifically for test usag - Then the user of this container will have the permission to write test-result into container. - you could look up the container's id by `docker cp` then copy the test-results into host folder by `docker cp :/app/test-results .` +### About the manual test + +Currently we have several steps that require manually testing. + +- Please follow the step above to setup the VDP backend +- Please create all the model list [here](https://github.com/instill-ai/vdp#model-hub) +- In the `/models` page, please make sure all the created models are correctly listed +- Please click every listed model to go to the model details page `/models/:model_id` +- Please check the model state on the `/models/:model_id` page, you should select the model_instance_tag in the dropdown to the one you just deployed. The model state should be `Online` +- Please switch the state toggle button, the model_state should be `Unspecified` and after a while it should be Offline. Please do it again to check whether it can switch back to the Online state. +- Please use the model you just created to create a sync pipeline. +- Go to the `pipelines/:pipeline_id` page you just created. +- If you switch the state toggle button, it should warn you `Pipeline pipeline-hehe is in the SYNC mode, which is always active` +- Please create a async pipeline with local json destination +- Please go to `pipeline/:pipeline_id` page to check it has correctly displayed data ## Other Caveats diff --git a/integration-test/common/model.ts b/integration-test/common/model.ts index 3e7648bd4..503c73fcd 100644 --- a/integration-test/common/model.ts +++ b/integration-test/common/model.ts @@ -132,8 +132,6 @@ export const expectCorrectModelDetails = async ({ additionalRules, }: ExpectCorrectModelDetailsProps) => { // Mimic the behavior of long running operation - await delay(20000); - await page.goto(`/models/${modelId}`, { waitUntil: "networkidle" }); // Should have proper title @@ -164,22 +162,24 @@ export const expectCorrectModelDetails = async ({ ); await expect(selectedModelInstanceTag).toHaveText(modelInstanceTag); + // Temporaily disable test related to long run operation + // Should display online and have correct toggle button state - const modelStateLabel = page.locator("data-testid=state-label"); - const stateToggle = page.locator("#pipelineStateToggleButton"); - if (modelState === "STATE_ONLINE") { - await expect(modelStateLabel).toHaveText("Online", { timeout: 20000 }); - expect(await stateToggle.isChecked()).toBeTruthy(); - } else if (modelState === "STATE_OFFLINE") { - await expect(modelStateLabel).toHaveText("Offline", { timeout: 20000 }); - expect(await stateToggle.isChecked()).not.toBeTruthy(); - } else if (modelState === "STATE_UNSPECIFIED") { - await expect(modelStateLabel).toHaveText("Unspecified", { timeout: 20000 }); - expect(await stateToggle.isChecked()).not.toBeTruthy(); - } else { - await expect(modelStateLabel).toHaveText("Error", { timeout: 20000 }); - expect(await stateToggle.isChecked()).not.toBeTruthy(); - } + // const modelStateLabel = page.locator("data-testid=state-label"); + // const stateToggle = page.locator("#pipelineStateToggleButton"); + // if (modelState === "STATE_ONLINE") { + // await expect(modelStateLabel).toHaveText("Online", { timeout: 20000 }); + // expect(await stateToggle.isChecked()).toBeTruthy(); + // } else if (modelState === "STATE_OFFLINE") { + // await expect(modelStateLabel).toHaveText("Offline", { timeout: 20000 }); + // expect(await stateToggle.isChecked()).not.toBeTruthy(); + // } else if (modelState === "STATE_UNSPECIFIED") { + // await expect(modelStateLabel).toHaveText("Unspecified", { timeout: 20000 }); + // expect(await stateToggle.isChecked()).not.toBeTruthy(); + // } else { + // await expect(modelStateLabel).toHaveText("Error", { timeout: 20000 }); + // expect(await stateToggle.isChecked()).not.toBeTruthy(); + // } if (additionalRules) await additionalRules(); }; diff --git a/integration-test/common/pipeline.ts b/integration-test/common/pipeline.ts index 00c3b736a..5d1345169 100644 --- a/integration-test/common/pipeline.ts +++ b/integration-test/common/pipeline.ts @@ -158,22 +158,24 @@ export const expectCorrectPipelineDetails = async ({ const modeLabel = page.locator("data-testid=pipeline-mode-label"); await expect(modeLabel).toHaveText(mode); + // Temporaily disable test related to long run operation + // Should have correct state label and toggle state button - const stateLabel = page.locator("data-testid=state-label"); - const stateToggle = page.locator("#pipelineStateToggleButton"); - if (state === "STATE_ACTIVE") { - await expect(stateLabel).toHaveText("Active"); - expect(await stateToggle.isChecked()).toBeTruthy(); - } else if (state === "STATE_INACTIVE") { - await expect(stateLabel).toHaveText("Inactive"); - expect(await stateToggle.isChecked()).not.toBeTruthy(); - } else if (state === "STATE_UNSPECIFIED") { - await expect(stateLabel).toHaveText("Unspecified"); - expect(await stateToggle.isChecked()).not.toBeTruthy(); - } else { - await expect(stateLabel).toHaveText("Error"); - expect(await stateToggle.isChecked()).not.toBeTruthy(); - } + // const stateLabel = page.locator("data-testid=state-label"); + // const stateToggle = page.locator("#pipelineStateToggleButton"); + // if (state === "STATE_ACTIVE") { + // await expect(stateLabel).toHaveText("Active"); + // expect(await stateToggle.isChecked()).toBeTruthy(); + // } else if (state === "STATE_INACTIVE") { + // await expect(stateLabel).toHaveText("Inactive"); + // expect(await stateToggle.isChecked()).not.toBeTruthy(); + // } else if (state === "STATE_UNSPECIFIED") { + // await expect(stateLabel).toHaveText("Unspecified"); + // expect(await stateToggle.isChecked()).not.toBeTruthy(); + // } else { + // await expect(stateLabel).toHaveText("Error"); + // expect(await stateToggle.isChecked()).not.toBeTruthy(); + // } // Should have correct description const descriptionField = page.locator("textarea#pipelineDescription"); diff --git a/package.json b/package.json index 59c2bfddb..385bf75fa 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "docker-build": "docker build -f Dockerfile -t instill-console .", "docker-run": "docker run --rm -t --network instill-network --entrypoint ./entrypoint.sh -p 3000:3000 -e NEXT_PUBLIC_CONSOLE_BASE_URL='http://localhost:3000' -e NEXT_PUBLIC_API_GATEWAY_BASE_URL_FOR_CLIENT='http://localhost:8080' -e NEXT_PUBLIC_API_VERSION='v1alpha' -e NEXT_PUBLIC_INSTILL_AI_USER_COOKIE_NAME='instill-ai-user' -e API_GATEWAY_BASE_URL_FOR_SSR=http://api-gateway:8080 instill-console", "docker-build-test": "docker build -f Dockerfile.playwright --build-arg TEST_USER='root' -t instill-console-integration .", - "docker-run-test": "docker run --rm -t --network instill-network --entrypoint ./entrypoint-playwright.sh -e NEXT_PUBLIC_CONSOLE_BASE_URL='http://localhost:3000' -e NEXT_PUBLIC_API_GATEWAY_BASE_URL_FOR_CLIENT='https://localhost:8080' -e NEXT_PUBLIC_API_VERSION='v1alpha' -e NEXT_PUBLIC_INSTILL_AI_USER_COOKIE_NAME='instill-ai-user' -e NEXT_PUBLIC_SELF_SIGNED_CERTIFICATION=true instill-console-integration", + "docker-run-test": "docker run --rm -t --network instill-network --entrypoint ./entrypoint-playwright.sh -e NEXT_PUBLIC_CONSOLE_BASE_URL='http://console:3000' -e NEXT_PUBLIC_API_GATEWAY_BASE_URL_FOR_CLIENT='http://api-gateway:8080' -e NEXT_PUBLIC_API_VERSION='v1alpha' -e NEXT_PUBLIC_INSTILL_AI_USER_COOKIE_NAME='instill-ai-user' -e NEXT_PUBLIC_SELF_SIGNED_CERTIFICATION=true instill-console-integration", "docker:prune-cache": "docker buildx prune", "dev": "bash env.sh && next dev", "build": "next build",