tests: new tests folders organization (#3716)
* new tests folders organizations * 📝 (nightly_build.yml): update tests_folder path from "tests/scheduled" to "tests/core" to reflect the correct location of the tests folder * renaming test folder * changing e2e to integrations folder * 📝 (frontend/tsconfig.json): update test file paths to reflect changes in folder structure for better organization and clarity * change assets folder * 📝 (frontend): update file paths to remove redundant 'core' directory in test assets * 📝 (Document QA.spec.ts, Vector Store.spec.ts, fileUploadComponent.spec.ts): Update file paths to correctly reference test assets in integration and unit tests. * github suggestions
This commit is contained in:
parent
cc52f5f00d
commit
6061951cba
87 changed files with 60 additions and 55 deletions
14
.github/workflows/ci.yml
vendored
14
.github/workflows/ci.yml
vendored
|
|
@ -12,7 +12,7 @@ on:
|
||||||
description: "Frontend Tests Folder"
|
description: "Frontend Tests Folder"
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
default: "tests/end-to-end"
|
default: "tests/core"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
branch:
|
branch:
|
||||||
|
|
@ -35,7 +35,6 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [synchronize, labeled]
|
types: [synchronize, labeled]
|
||||||
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
@ -109,7 +108,14 @@ jobs:
|
||||||
# https://github.com/langchain-ai/langchain/blob/master/.github/workflows/check_diffs.yml
|
# https://github.com/langchain-ai/langchain/blob/master/.github/workflows/check_diffs.yml
|
||||||
ci_success:
|
ci_success:
|
||||||
name: "CI Success"
|
name: "CI Success"
|
||||||
needs: [test-backend,test-frontend,lint-backend,test-docs-build,set-ci-condition]
|
needs:
|
||||||
|
[
|
||||||
|
test-backend,
|
||||||
|
test-frontend,
|
||||||
|
lint-backend,
|
||||||
|
test-docs-build,
|
||||||
|
set-ci-condition,
|
||||||
|
]
|
||||||
|
|
||||||
if: always()
|
if: always()
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -123,4 +129,4 @@ jobs:
|
||||||
echo $JOBS_JSON
|
echo $JOBS_JSON
|
||||||
echo $RESULTS_JSON
|
echo $RESULTS_JSON
|
||||||
echo "Exiting with $EXIT_CODE"
|
echo "Exiting with $EXIT_CODE"
|
||||||
exit $EXIT_CODE
|
exit $EXIT_CODE
|
||||||
|
|
|
||||||
2
.github/workflows/nightly_build.yml
vendored
2
.github/workflows/nightly_build.yml
vendored
|
|
@ -74,7 +74,7 @@ jobs:
|
||||||
needs: create-nightly-tag
|
needs: create-nightly-tag
|
||||||
uses: ./.github/workflows/typescript_test.yml
|
uses: ./.github/workflows/typescript_test.yml
|
||||||
with:
|
with:
|
||||||
tests_folder: "tests/end-to-end"
|
tests_folder: "tests/core"
|
||||||
ref: ${{ needs.create-nightly-tag.outputs.tag }}
|
ref: ${{ needs.create-nightly-tag.outputs.tag }}
|
||||||
secrets:
|
secrets:
|
||||||
OPENAI_API_KEY: "${{ secrets.OPENAI_API_KEY }}"
|
OPENAI_API_KEY: "${{ secrets.OPENAI_API_KEY }}"
|
||||||
|
|
|
||||||
|
|
@ -99,9 +99,9 @@ fi
|
||||||
|
|
||||||
# Run Playwright tests
|
# Run Playwright tests
|
||||||
if [ "$ui" = true ]; then
|
if [ "$ui" = true ]; then
|
||||||
TEST_COMMAND="npx playwright test tests/end-to-end --ui --project=chromium"
|
TEST_COMMAND="npx playwright test tests/core --ui --project=chromium"
|
||||||
else
|
else
|
||||||
TEST_COMMAND="npx playwright test tests/end-to-end --project=chromium"
|
TEST_COMMAND="npx playwright test tests/core --project=chromium"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! PLAYWRIGHT_HTML_REPORT=playwright-report/e2e $TEST_COMMAND; then
|
if ! PLAYWRIGHT_HTML_REPORT=playwright-report/e2e $TEST_COMMAND; then
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
|
@ -68,7 +68,7 @@ test("user must be able to send an image on chat", async ({ page }) => {
|
||||||
await page.getByText("Playground", { exact: true }).click();
|
await page.getByText("Playground", { exact: true }).click();
|
||||||
|
|
||||||
// Read the image file as a binary string
|
// Read the image file as a binary string
|
||||||
const filePath = "tests/end-to-end/assets/chain.png";
|
const filePath = "tests/assets/chain.png";
|
||||||
const fileContent = readFileSync(filePath, "base64");
|
const fileContent = readFileSync(filePath, "base64");
|
||||||
|
|
||||||
// Create the DataTransfer and File objects within the browser context
|
// Create the DataTransfer and File objects within the browser context
|
||||||
|
|
@ -78,10 +78,7 @@ test("add a flow into a folder by drag and drop", async ({ page }) => {
|
||||||
timeout: 50000,
|
timeout: 50000,
|
||||||
});
|
});
|
||||||
|
|
||||||
const jsonContent = readFileSync(
|
const jsonContent = readFileSync("tests/assets/collection.json", "utf-8");
|
||||||
"tests/end-to-end/assets/collection.json",
|
|
||||||
"utf-8",
|
|
||||||
);
|
|
||||||
|
|
||||||
// Wait for the target element to be available before evaluation
|
// Wait for the target element to be available before evaluation
|
||||||
|
|
||||||
|
|
@ -28,7 +28,7 @@ test.describe("save component tests", () => {
|
||||||
|
|
||||||
// Read your file into a buffer.
|
// Read your file into a buffer.
|
||||||
const jsonContent = readFileSync(
|
const jsonContent = readFileSync(
|
||||||
"tests/end-to-end/assets/flow_group_test.json",
|
"tests/assets/flow_group_test.json",
|
||||||
"utf-8",
|
"utf-8",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -64,7 +64,9 @@ test("Document QA", async ({ page }) => {
|
||||||
const fileChooserPromise = page.waitForEvent("filechooser");
|
const fileChooserPromise = page.waitForEvent("filechooser");
|
||||||
await page.getByTestId("icon-FileSearch2").click();
|
await page.getByTestId("icon-FileSearch2").click();
|
||||||
const fileChooser = await fileChooserPromise;
|
const fileChooser = await fileChooserPromise;
|
||||||
await fileChooser.setFiles(path.join(__dirname, "/assets/test_file.txt"));
|
await fileChooser.setFiles(
|
||||||
|
path.join(__dirname, "../../assets/test_file.txt"),
|
||||||
|
);
|
||||||
await page.getByText("test_file.txt").isVisible();
|
await page.getByText("test_file.txt").isVisible();
|
||||||
|
|
||||||
await page.waitForTimeout(1000);
|
await page.waitForTimeout(1000);
|
||||||
|
|
@ -96,7 +96,9 @@ test("Vector Store RAG", async ({ page }) => {
|
||||||
const fileChooserPromise = page.waitForEvent("filechooser");
|
const fileChooserPromise = page.waitForEvent("filechooser");
|
||||||
await page.getByTestId("icon-FileSearch2").last().click();
|
await page.getByTestId("icon-FileSearch2").last().click();
|
||||||
const fileChooser = await fileChooserPromise;
|
const fileChooser = await fileChooserPromise;
|
||||||
await fileChooser.setFiles(path.join(__dirname, "/assets/test_file.txt"));
|
await fileChooser.setFiles(
|
||||||
|
path.join(__dirname, "../../assets/test_file.txt"),
|
||||||
|
);
|
||||||
await page.getByText("test_file.txt").isVisible();
|
await page.getByText("test_file.txt").isVisible();
|
||||||
|
|
||||||
await page.waitForTimeout(1000);
|
await page.waitForTimeout(1000);
|
||||||
|
|
@ -54,7 +54,7 @@ test("should be able to upload a file", async ({ page }) => {
|
||||||
await page.getByTestId("icon-FileSearch2").click();
|
await page.getByTestId("icon-FileSearch2").click();
|
||||||
const fileChooser = await fileChooserPromise;
|
const fileChooser = await fileChooserPromise;
|
||||||
await fileChooser.setFiles(
|
await fileChooser.setFiles(
|
||||||
path.join(__dirname, "../end-to-end/assets/test_file.txt"),
|
path.join(__dirname, "../../assets/test_file.txt"),
|
||||||
);
|
);
|
||||||
await page.getByText("test_file.txt").isVisible();
|
await page.getByText("test_file.txt").isVisible();
|
||||||
|
|
||||||
|
|
@ -25,10 +25,7 @@ test.describe("drag and drop test", () => {
|
||||||
|
|
||||||
await page.locator("span").filter({ hasText: "My Collection" }).isVisible();
|
await page.locator("span").filter({ hasText: "My Collection" }).isVisible();
|
||||||
// Read your file into a buffer.
|
// Read your file into a buffer.
|
||||||
const jsonContent = readFileSync(
|
const jsonContent = readFileSync("tests/assets/collection.json", "utf-8");
|
||||||
"tests/end-to-end/assets/collection.json",
|
|
||||||
"utf-8",
|
|
||||||
);
|
|
||||||
|
|
||||||
// Create the DataTransfer and File
|
// Create the DataTransfer and File
|
||||||
const dataTransfer = await page.evaluateHandle((data) => {
|
const dataTransfer = await page.evaluateHandle((data) => {
|
||||||
|
|
@ -24,39 +24,40 @@
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src",
|
"src",
|
||||||
"tests/end-to-end/saveComponents.spec.ts",
|
"tests/core/saveComponents.spec.ts",
|
||||||
"tests/scheduled-end-to-end/actionsMainPage-shard-1.spec.ts",
|
"tests/extended/actionsMainPage-shard-1.spec.ts",
|
||||||
"tests/end-to-end/auto_login.spec.ts",
|
"tests/core/auto_login.spec.ts",
|
||||||
"tests/scheduled-end-to-end/chatInputOutput.spec.ts",
|
"tests/core/unit/chatInputOutput.spec.ts",
|
||||||
"tests/scheduled-end-to-end/chatInputOutputUser-shard-2.spec.ts",
|
"tests/extended/integrations/chatInputOutputUser-shard-2.spec.ts",
|
||||||
"tests/scheduled-end-to-end/codeAreaModalComponent.spec.ts",
|
"tests/core/unit/codeAreaModalComponent.spec.ts",
|
||||||
"tests/scheduled-end-to-end/curlApiGeneration.spec.ts",
|
"tests/extended/features/curlApiGeneration.spec.ts",
|
||||||
"tests/scheduled-end-to-end/deleteFlows.spec.ts",
|
"tests/extended/features/deleteFlows.spec.ts",
|
||||||
"tests/scheduled-end-to-end/dragAndDrop.spec.ts",
|
"tests/extended/features/dragAndDrop.spec.ts",
|
||||||
"tests/scheduled-end-to-end/dropdownComponent.spec.ts",
|
"tests/core/unit/dropdownComponent.spec.ts",
|
||||||
"tests/scheduled-end-to-end/fileUploadComponent.spec.ts",
|
"tests/core/unit/fileUploadComponent.spec.ts",
|
||||||
"tests/end-to-end/filterEdge.spec.ts",
|
"tests/core/filterEdge.spec.ts",
|
||||||
"tests/scheduled-end-to-end/floatComponent.spec.ts",
|
"tests/core/unit/floatComponent.spec.ts",
|
||||||
"tests/scheduled-end-to-end/flowPage.spec.ts",
|
"tests/extended/features/flowPage.spec.ts",
|
||||||
"tests/scheduled-end-to-end/flowSettings.spec.ts",
|
"tests/extended/features/flowSettings.spec.ts",
|
||||||
"tests/scheduled-end-to-end/generalBugs-shard-0.spec.ts",
|
"tests/extended/regression/generalBugs-shard-0.spec.ts",
|
||||||
"tests/end-to-end/globalVariables.spec.ts",
|
"tests/core/globalVariables.spec.ts",
|
||||||
"tests/end-to-end/group.spec.ts",
|
"tests/core/group.spec.ts",
|
||||||
"tests/scheduled-end-to-end/folders.spec.ts",
|
"tests/extended/folders.spec.ts",
|
||||||
"tests/scheduled-end-to-end/inputComponent.spec.ts",
|
"tests/core/unit/inputComponent.spec.ts",
|
||||||
"tests/end-to-end/inputListComponent.spec.ts",
|
"tests/core/inputListComponent.spec.ts",
|
||||||
"tests/scheduled-end-to-end/intComponent.spec.ts",
|
"tests/core/unit/intComponent.spec.ts",
|
||||||
"tests/end-to-end/keyPairListComponent.spec.ts",
|
"tests/core/keyPairListComponent.spec.ts",
|
||||||
"tests/scheduled-end-to-end/langflowShortcuts.spec.ts",
|
"tests/extended/features/langflowShortcuts.spec.ts",
|
||||||
"tests/end-to-end/nestedComponent.spec.ts",
|
"tests/core/nestedComponent.spec.ts",
|
||||||
"tests/scheduled-end-to-end/promptModalComponent.spec.ts",
|
"tests/core/unit/promptModalComponent.spec.ts",
|
||||||
"tests/end-to-end/python_api_generation.spec.ts",
|
"tests/core/python_api_generation.spec.ts",
|
||||||
"tests/scheduled-end-to-end/textAreaModalComponent.spec.ts",
|
"tests/core/unit/textAreaModalComponent.spec.ts",
|
||||||
"tests/end-to-end/textInputOutput.spec.ts",
|
"tests/core/textInputOutput.spec.ts",
|
||||||
"tests/scheduled-end-to-end/toggleComponent.spec.ts",
|
"tests/core/unit/toggleComponent.spec.ts",
|
||||||
"tests/end-to-end/tweaks_test.spec.ts",
|
"tests/core/tweaks_test.spec.ts",
|
||||||
"tests/scheduled-end-to-end/twoEdges.spec.ts",
|
"tests/extended/features/twoEdges.spec.ts",
|
||||||
"tests/scheduled-end-to-end/userSettings.spec.ts",
|
"tests/extended/features/userSettings.spec.ts",
|
||||||
"tests/end-to-end/store.spec.ts",
|
"tests/core/store.spec.ts",
|
||||||
"tests/end-to-end/logs.spec.ts" ]
|
"tests/core/logs.spec.ts"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue