Skip to content

Commit

Permalink
feat: turn off test related to long running operation (#354)
Browse files Browse the repository at this point in the history
Because

- #353

This commit

- turn off test related to long running operation
  • Loading branch information
EiffelFly committed Feb 21, 2023
1 parent bb0e955 commit f28be7c
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 34 deletions.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand All @@ -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 <container_id>:/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

Expand Down
34 changes: 17 additions & 17 deletions integration-test/common/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
};
Expand Down
32 changes: 17 additions & 15 deletions integration-test/common/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f28be7c

Please sign in to comment.