diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76631111cbaa..07196d2942b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,13 +23,12 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true - jobs: set-ci-condition: name: Should Run CI runs-on: ubuntu-latest outputs: - should-run-ci: ${{ (contains( github.event.pull_request.labels.*.name, 'lgtm') && github.event.pull_request.draft == false) || (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') }} + should-run-ci: ${{ (contains( github.event.pull_request.labels.*.name, 'lgtm') && github.event.pull_request.draft == false) || (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') }} steps: # Do anything just to make the job run - run: echo "Debug CI Condition" @@ -71,6 +70,8 @@ jobs: name: Run Frontend Tests if: ${{ needs.path-filter.outputs.python == 'true' || needs.path-filter.outputs.frontend == 'true' || needs.path-filter.outputs.tests == 'true' }} uses: ./.github/workflows/typescript_test.yml + with: + tests_folder: "tests/end-to-end" secrets: OPENAI_API_KEY: "${{ secrets.OPENAI_API_KEY }}" STORE_API_KEY: "${{ secrets.STORE_API_KEY }}" @@ -91,7 +92,14 @@ jobs: # https://github.com/langchain-ai/langchain/blob/master/.github/workflows/check_diffs.yml 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() runs-on: ubuntu-latest env: @@ -104,4 +112,4 @@ jobs: echo $JOBS_JSON echo $RESULTS_JSON echo "Exiting with $EXIT_CODE" - exit $EXIT_CODE \ No newline at end of file + exit $EXIT_CODE diff --git a/.github/workflows/typescript_test.yml b/.github/workflows/typescript_test.yml index ea857e5a6507..4bcd9834dcfc 100644 --- a/.github/workflows/typescript_test.yml +++ b/.github/workflows/typescript_test.yml @@ -7,12 +7,23 @@ on: required: true STORE_API_KEY: required: true + inputs: + tests_folder: + description: "(Optional) Tests to run" + required: false + type: string + default: "tests" workflow_dispatch: inputs: branch: description: "(Optional) Branch to checkout" required: false type: string + tests_folder: + description: "(Optional) Tests to run" + required: false + type: string + default: "tests" env: POETRY_VERSION: "1.8.3" @@ -29,30 +40,8 @@ jobs: strategy: fail-fast: false matrix: - shardIndex: - [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - ] - shardTotal: [20] + shardIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + shardTotal: [10] env: OPENAI_API_KEY: ${{ inputs.openai_api_key || secrets.OPENAI_API_KEY }} STORE_API_KEY: ${{ inputs.store_api_key || secrets.STORE_API_KEY }} @@ -138,7 +127,7 @@ jobs: max_attempts: 2 command: | cd src/frontend - npx playwright test --trace on --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers 2 + npx playwright test ${{ inputs.tests_folder }} --trace on --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers 2 - name: Upload blob report to GitHub Actions Artifacts if: always() @@ -158,8 +147,8 @@ jobs: EXIT_CODE: ${{!contains(needs.setup-and-test.result, 'failure') && !contains(needs.setup-and-test.result, 'cancelled') && '0' || '1'}} steps: - name: "Should Merge Reports" - # If the CI was successful, we don't need to merge the reports - # so we can skip all the steps below + # If the CI was successful, we don't need to merge the reports + # so we can skip all the steps below id: should_merge_reports run: | if [ "$EXIT_CODE" == "0" ]; then diff --git a/src/frontend/tests/end-to-end/filterEdge-shard-0.spec.ts b/src/frontend/tests/end-to-end/filterEdge-shard-0.spec.ts index 6733e9020adf..beb11bd74202 100644 --- a/src/frontend/tests/end-to-end/filterEdge-shard-0.spec.ts +++ b/src/frontend/tests/end-to-end/filterEdge-shard-0.spec.ts @@ -1,6 +1,8 @@ import { expect, test } from "@playwright/test"; -test("RetrievalQA - Tooltip", async ({ page }) => { +test("user must see on handle hover a tooltip with possibility connections", async ({ + page, +}) => { await page.goto("/"); await page.waitForTimeout(1000); diff --git a/src/frontend/tests/end-to-end/filterSidebar.spec.ts b/src/frontend/tests/end-to-end/filterSidebar.spec.ts index e4a30ae281ee..12d2dcbbbda9 100644 --- a/src/frontend/tests/end-to-end/filterSidebar.spec.ts +++ b/src/frontend/tests/end-to-end/filterSidebar.spec.ts @@ -1,6 +1,8 @@ import { expect, test } from "@playwright/test"; -test("LLMChain - Filter", async ({ page }) => { +test("user must see on handle click the possibility connections - LLMChain", async ({ + page, +}) => { await page.goto("/"); await page.waitForTimeout(2000); diff --git a/src/frontend/tests/end-to-end/globalVariables.spec.ts b/src/frontend/tests/end-to-end/globalVariables.spec.ts index 74b0acc4d0ae..702569ac1f34 100644 --- a/src/frontend/tests/end-to-end/globalVariables.spec.ts +++ b/src/frontend/tests/end-to-end/globalVariables.spec.ts @@ -1,6 +1,8 @@ import { expect, test } from "@playwright/test"; -test("GlobalVariables", async ({ page }) => { +test("user must be able to save or delete a global variable", async ({ + page, +}) => { await page.goto("/"); await page.waitForTimeout(2000); diff --git a/src/frontend/tests/end-to-end/actionsMainPage-shard-0.spec.ts b/src/frontend/tests/scheduled-end-to-end/actionsMainPage-shard-0.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/actionsMainPage-shard-0.spec.ts rename to src/frontend/tests/scheduled-end-to-end/actionsMainPage-shard-0.spec.ts diff --git a/src/frontend/tests/end-to-end/autoLogin.spec.ts b/src/frontend/tests/scheduled-end-to-end/autoLogin.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/autoLogin.spec.ts rename to src/frontend/tests/scheduled-end-to-end/autoLogin.spec.ts diff --git a/src/frontend/tests/end-to-end/chatInputOutput.spec.ts b/src/frontend/tests/scheduled-end-to-end/chatInputOutput.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/chatInputOutput.spec.ts rename to src/frontend/tests/scheduled-end-to-end/chatInputOutput.spec.ts diff --git a/src/frontend/tests/end-to-end/chatInputOutputUser-shard-1.spec.ts b/src/frontend/tests/scheduled-end-to-end/chatInputOutputUser-shard-1.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/chatInputOutputUser-shard-1.spec.ts rename to src/frontend/tests/scheduled-end-to-end/chatInputOutputUser-shard-1.spec.ts diff --git a/src/frontend/tests/end-to-end/chatInputOutputUser-shard-2.spec.ts b/src/frontend/tests/scheduled-end-to-end/chatInputOutputUser-shard-2.spec.ts similarity index 99% rename from src/frontend/tests/end-to-end/chatInputOutputUser-shard-2.spec.ts rename to src/frontend/tests/scheduled-end-to-end/chatInputOutputUser-shard-2.spec.ts index d0c10319203a..ac7d7de3ce63 100644 --- a/src/frontend/tests/end-to-end/chatInputOutputUser-shard-2.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/chatInputOutputUser-shard-2.spec.ts @@ -1,6 +1,5 @@ import { expect, test } from "@playwright/test"; import * as dotenv from "dotenv"; -import { readFileSync } from "fs"; import path from "path"; test("user must interact with chat with Input/Output", async ({ page }) => { diff --git a/src/frontend/tests/end-to-end/codeAreaModalComponent.spec.ts b/src/frontend/tests/scheduled-end-to-end/codeAreaModalComponent.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/codeAreaModalComponent.spec.ts rename to src/frontend/tests/scheduled-end-to-end/codeAreaModalComponent.spec.ts diff --git a/src/frontend/tests/end-to-end/curlApiGeneration.spec.ts b/src/frontend/tests/scheduled-end-to-end/curlApiGeneration.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/curlApiGeneration.spec.ts rename to src/frontend/tests/scheduled-end-to-end/curlApiGeneration.spec.ts diff --git a/src/frontend/tests/end-to-end/deleteComponents.spec.ts b/src/frontend/tests/scheduled-end-to-end/deleteComponents.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/deleteComponents.spec.ts rename to src/frontend/tests/scheduled-end-to-end/deleteComponents.spec.ts diff --git a/src/frontend/tests/end-to-end/deleteFlows.spec.ts b/src/frontend/tests/scheduled-end-to-end/deleteFlows.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/deleteFlows.spec.ts rename to src/frontend/tests/scheduled-end-to-end/deleteFlows.spec.ts diff --git a/src/frontend/tests/end-to-end/dragAndDrop.spec.ts b/src/frontend/tests/scheduled-end-to-end/dragAndDrop.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/dragAndDrop.spec.ts rename to src/frontend/tests/scheduled-end-to-end/dragAndDrop.spec.ts diff --git a/src/frontend/tests/end-to-end/dropdownComponent.spec.ts b/src/frontend/tests/scheduled-end-to-end/dropdownComponent.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/dropdownComponent.spec.ts rename to src/frontend/tests/scheduled-end-to-end/dropdownComponent.spec.ts diff --git a/src/frontend/tests/end-to-end/fileUploadComponent.spec.ts b/src/frontend/tests/scheduled-end-to-end/fileUploadComponent.spec.ts similarity index 97% rename from src/frontend/tests/end-to-end/fileUploadComponent.spec.ts rename to src/frontend/tests/scheduled-end-to-end/fileUploadComponent.spec.ts index 30bee33d8fa5..3fd3d8993aad 100644 --- a/src/frontend/tests/end-to-end/fileUploadComponent.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/fileUploadComponent.spec.ts @@ -47,7 +47,9 @@ test("should be able to upload a file", async ({ page }) => { const fileChooserPromise = page.waitForEvent("filechooser"); await page.getByTestId("icon-FileSearch2").click(); const fileChooser = await fileChooserPromise; - await fileChooser.setFiles(path.join(__dirname, "/assets/test_file.txt")); + await fileChooser.setFiles( + path.join(__dirname, "../end-to-end/assets/test_file.txt"), + ); await page.getByText("test_file.txt").isVisible(); await page.getByPlaceholder("Search").click(); diff --git a/src/frontend/tests/end-to-end/filterEdge-shard-1.spec.ts b/src/frontend/tests/scheduled-end-to-end/filterEdge-shard-1.spec.ts similarity index 98% rename from src/frontend/tests/end-to-end/filterEdge-shard-1.spec.ts rename to src/frontend/tests/scheduled-end-to-end/filterEdge-shard-1.spec.ts index 8274a07970d5..907537ff7fee 100644 --- a/src/frontend/tests/end-to-end/filterEdge-shard-1.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/filterEdge-shard-1.spec.ts @@ -1,6 +1,8 @@ import { expect, test } from "@playwright/test"; -test("RetrievalQA - Filter", async ({ page }) => { +test("user must see on handle click the possibility connections - RetrievalQA", async ({ + page, +}) => { await page.goto("/"); await page.waitForTimeout(2000); diff --git a/src/frontend/tests/end-to-end/floatComponent.spec.ts b/src/frontend/tests/scheduled-end-to-end/floatComponent.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/floatComponent.spec.ts rename to src/frontend/tests/scheduled-end-to-end/floatComponent.spec.ts diff --git a/src/frontend/tests/end-to-end/flowPage.spec.ts b/src/frontend/tests/scheduled-end-to-end/flowPage.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/flowPage.spec.ts rename to src/frontend/tests/scheduled-end-to-end/flowPage.spec.ts diff --git a/src/frontend/tests/end-to-end/flowSettings.spec.ts b/src/frontend/tests/scheduled-end-to-end/flowSettings.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/flowSettings.spec.ts rename to src/frontend/tests/scheduled-end-to-end/flowSettings.spec.ts diff --git a/src/frontend/tests/end-to-end/generalBugs-shard-0.spec.ts b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-0.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/generalBugs-shard-0.spec.ts rename to src/frontend/tests/scheduled-end-to-end/generalBugs-shard-0.spec.ts diff --git a/src/frontend/tests/end-to-end/generalBugs-shard-1.spec.ts b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-1.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/generalBugs-shard-1.spec.ts rename to src/frontend/tests/scheduled-end-to-end/generalBugs-shard-1.spec.ts diff --git a/src/frontend/tests/end-to-end/generalBugs-shard-10.spec.ts b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-10.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/generalBugs-shard-10.spec.ts rename to src/frontend/tests/scheduled-end-to-end/generalBugs-shard-10.spec.ts diff --git a/src/frontend/tests/end-to-end/generalBugs-shard-2.spec.ts b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-2.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/generalBugs-shard-2.spec.ts rename to src/frontend/tests/scheduled-end-to-end/generalBugs-shard-2.spec.ts diff --git a/src/frontend/tests/end-to-end/generalBugs-shard-3.spec.ts b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-3.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/generalBugs-shard-3.spec.ts rename to src/frontend/tests/scheduled-end-to-end/generalBugs-shard-3.spec.ts diff --git a/src/frontend/tests/end-to-end/generalBugs-shard-6.spec.ts b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-6.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/generalBugs-shard-6.spec.ts rename to src/frontend/tests/scheduled-end-to-end/generalBugs-shard-6.spec.ts diff --git a/src/frontend/tests/end-to-end/generalBugs-shard-7.spec.ts b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-7.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/generalBugs-shard-7.spec.ts rename to src/frontend/tests/scheduled-end-to-end/generalBugs-shard-7.spec.ts diff --git a/src/frontend/tests/end-to-end/generalBugs-shard-8.spec.ts b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-8.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/generalBugs-shard-8.spec.ts rename to src/frontend/tests/scheduled-end-to-end/generalBugs-shard-8.spec.ts diff --git a/src/frontend/tests/end-to-end/inputComponent.spec.ts b/src/frontend/tests/scheduled-end-to-end/inputComponent.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/inputComponent.spec.ts rename to src/frontend/tests/scheduled-end-to-end/inputComponent.spec.ts diff --git a/src/frontend/tests/end-to-end/intComponent.spec.ts b/src/frontend/tests/scheduled-end-to-end/intComponent.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/intComponent.spec.ts rename to src/frontend/tests/scheduled-end-to-end/intComponent.spec.ts diff --git a/src/frontend/tests/end-to-end/langflowShortcuts.spec.ts b/src/frontend/tests/scheduled-end-to-end/langflowShortcuts.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/langflowShortcuts.spec.ts rename to src/frontend/tests/scheduled-end-to-end/langflowShortcuts.spec.ts diff --git a/src/frontend/tests/end-to-end/promptModalComponent.spec.ts b/src/frontend/tests/scheduled-end-to-end/promptModalComponent.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/promptModalComponent.spec.ts rename to src/frontend/tests/scheduled-end-to-end/promptModalComponent.spec.ts diff --git a/src/frontend/tests/end-to-end/pythonApiGeneration.spec.ts b/src/frontend/tests/scheduled-end-to-end/pythonApiGeneration.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/pythonApiGeneration.spec.ts rename to src/frontend/tests/scheduled-end-to-end/pythonApiGeneration.spec.ts diff --git a/src/frontend/tests/end-to-end/store-shard-0.spec.ts b/src/frontend/tests/scheduled-end-to-end/store-shard-0.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/store-shard-0.spec.ts rename to src/frontend/tests/scheduled-end-to-end/store-shard-0.spec.ts diff --git a/src/frontend/tests/end-to-end/store-shard-1.spec.ts b/src/frontend/tests/scheduled-end-to-end/store-shard-1.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/store-shard-1.spec.ts rename to src/frontend/tests/scheduled-end-to-end/store-shard-1.spec.ts diff --git a/src/frontend/tests/end-to-end/store-shard-3.spec.ts b/src/frontend/tests/scheduled-end-to-end/store-shard-3.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/store-shard-3.spec.ts rename to src/frontend/tests/scheduled-end-to-end/store-shard-3.spec.ts diff --git a/src/frontend/tests/end-to-end/textAreaModalComponent.spec.ts b/src/frontend/tests/scheduled-end-to-end/textAreaModalComponent.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/textAreaModalComponent.spec.ts rename to src/frontend/tests/scheduled-end-to-end/textAreaModalComponent.spec.ts diff --git a/src/frontend/tests/end-to-end/toggleComponent.spec.ts b/src/frontend/tests/scheduled-end-to-end/toggleComponent.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/toggleComponent.spec.ts rename to src/frontend/tests/scheduled-end-to-end/toggleComponent.spec.ts diff --git a/src/frontend/tests/end-to-end/twoEdges.spec.ts b/src/frontend/tests/scheduled-end-to-end/twoEdges.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/twoEdges.spec.ts rename to src/frontend/tests/scheduled-end-to-end/twoEdges.spec.ts diff --git a/src/frontend/tests/end-to-end/userSettings.spec.ts b/src/frontend/tests/scheduled-end-to-end/userSettings.spec.ts similarity index 100% rename from src/frontend/tests/end-to-end/userSettings.spec.ts rename to src/frontend/tests/scheduled-end-to-end/userSettings.spec.ts diff --git a/src/frontend/tsconfig.json b/src/frontend/tsconfig.json index fafa3093501d..6704d97b23fa 100644 --- a/src/frontend/tsconfig.json +++ b/src/frontend/tsconfig.json @@ -25,38 +25,38 @@ "include": [ "src", "tests/end-to-end/saveComponents.spec.ts", - "tests/end-to-end/actionsMainPage-shard-1.spec.ts", + "tests/scheduled-end-to-end/actionsMainPage-shard-1.spec.ts", "tests/end-to-end/auto_login.spec.ts", - "tests/end-to-end/chatInputOutput.spec.ts", - "tests/end-to-end/chatInputOutputUser-shard-2.spec.ts", - "tests/end-to-end/codeAreaModalComponent.spec.ts", - "tests/end-to-end/curlApiGeneration.spec.ts", - "tests/end-to-end/deleteFlows.spec.ts", - "tests/end-to-end/dragAndDrop.spec.ts", - "tests/end-to-end/dropdownComponent.spec.ts", - "tests/end-to-end/fileUploadComponent.spec.ts", + "tests/scheduled-end-to-end/chatInputOutput.spec.ts", + "tests/scheduled-end-to-end/chatInputOutputUser-shard-2.spec.ts", + "tests/scheduled-end-to-end/codeAreaModalComponent.spec.ts", + "tests/scheduled-end-to-end/curlApiGeneration.spec.ts", + "tests/scheduled-end-to-end/deleteFlows.spec.ts", + "tests/scheduled-end-to-end/dragAndDrop.spec.ts", + "tests/scheduled-end-to-end/dropdownComponent.spec.ts", + "tests/scheduled-end-to-end/fileUploadComponent.spec.ts", "tests/end-to-end/filterEdge.spec.ts", - "tests/end-to-end/floatComponent.spec.ts", - "tests/end-to-end/flowPage.spec.ts", - "tests/end-to-end/flowSettings.spec.ts", - "tests/end-to-end/generalBugs-shard-0.spec.ts", + "tests/scheduled-end-to-end/floatComponent.spec.ts", + "tests/scheduled-end-to-end/flowPage.spec.ts", + "tests/scheduled-end-to-end/flowSettings.spec.ts", + "tests/scheduled-end-to-end/generalBugs-shard-0.spec.ts", "tests/end-to-end/globalVariables.spec.ts", "tests/end-to-end/group.spec.ts", - "tests/end-to-end/folders.spec.ts", - "tests/end-to-end/inputComponent.spec.ts", + "tests/scheduled-end-to-end/folders.spec.ts", + "tests/scheduled-end-to-end/inputComponent.spec.ts", "tests/end-to-end/inputListComponent.spec.ts", - "tests/end-to-end/intComponent.spec.ts", + "tests/scheduled-end-to-end/intComponent.spec.ts", "tests/end-to-end/keyPairListComponent.spec.ts", - "tests/end-to-end/langflowShortcuts.spec.ts", + "tests/scheduled-end-to-end/langflowShortcuts.spec.ts", "tests/end-to-end/nestedComponent.spec.ts", - "tests/end-to-end/promptModalComponent.spec.ts", + "tests/scheduled-end-to-end/promptModalComponent.spec.ts", "tests/end-to-end/python_api_generation.spec.ts", - "tests/end-to-end/textAreaModalComponent.spec.ts", + "tests/scheduled-end-to-end/textAreaModalComponent.spec.ts", "tests/end-to-end/textInputOutput.spec.ts", - "tests/end-to-end/toggleComponent.spec.ts", + "tests/scheduled-end-to-end/toggleComponent.spec.ts", "tests/end-to-end/tweaks_test.spec.ts", - "tests/end-to-end/twoEdges.spec.ts", - "tests/end-to-end/userSettings.spec.ts", + "tests/scheduled-end-to-end/twoEdges.spec.ts", + "tests/scheduled-end-to-end/userSettings.spec.ts", "tests/end-to-end/store.spec.ts", "tests/end-to-end/logs.spec.ts" ]