Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: new tests folders organization #3716

Merged
merged 14 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
description: "Frontend Tests Folder"
required: false
type: string
default: "tests/end-to-end"
default: "tests/core"
workflow_dispatch:
inputs:
branch:
Expand All @@ -35,7 +35,6 @@ on:
pull_request:
types: [synchronize, labeled]


concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -109,7 +108,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
Expand All @@ -123,4 +129,4 @@ jobs:
echo $JOBS_JSON
echo $RESULTS_JSON
echo "Exiting with $EXIT_CODE"
exit $EXIT_CODE
exit $EXIT_CODE
2 changes: 1 addition & 1 deletion .github/workflows/nightly_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
needs: create-nightly-tag
uses: ./.github/workflows/typescript_test.yml
with:
tests_folder: "tests/end-to-end"
tests_folder: "tests/core"
ref: ${{ needs.create-nightly-tag.outputs.tag }}
secrets:
OPENAI_API_KEY: "${{ secrets.OPENAI_API_KEY }}"
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ fi

# Run Playwright tests
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
TEST_COMMAND="npx playwright test tests/end-to-end --project=chromium"
TEST_COMMAND="npx playwright test tests/core --project=chromium"
fi

if ! PLAYWRIGHT_HTML_REPORT=playwright-report/e2e $TEST_COMMAND; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ test("user must be able to send an image on chat", async ({ page }) => {
await page.getByText("Playground", { exact: true }).click();

// 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");

// Create the DataTransfer and File objects within the browser context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ test("add a flow into a folder by drag and drop", async ({ page }) => {
timeout: 50000,
});

const jsonContent = readFileSync(
"tests/end-to-end/assets/collection.json",
"utf-8",
);
const jsonContent = readFileSync("tests/assets/collection.json", "utf-8");

// Wait for the target element to be available before evaluation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test.describe("save component tests", () => {

// Read your file into a buffer.
const jsonContent = readFileSync(
"tests/end-to-end/assets/flow_group_test.json",
"tests/assets/flow_group_test.json",
"utf-8",
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ test("Document QA", 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, "../../assets/test_file.txt"),
);
await page.getByText("test_file.txt").isVisible();

await page.waitForTimeout(1000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ test("Vector Store RAG", async ({ page }) => {
const fileChooserPromise = page.waitForEvent("filechooser");
await page.getByTestId("icon-FileSearch2").last().click();
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.waitForTimeout(1000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ test("should be able to upload a file", async ({ page }) => {
await page.getByTestId("icon-FileSearch2").click();
const fileChooser = await fileChooserPromise;
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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ test.describe("drag and drop test", () => {

await page.locator("span").filter({ hasText: "My Collection" }).isVisible();
// Read your file into a buffer.
const jsonContent = readFileSync(
"tests/end-to-end/assets/collection.json",
"utf-8",
);
const jsonContent = readFileSync("tests/assets/collection.json", "utf-8");

// Create the DataTransfer and File
const dataTransfer = await page.evaluateHandle((data) => {
Expand Down
71 changes: 36 additions & 35 deletions src/frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,40 @@
},
"include": [
"src",
"tests/end-to-end/saveComponents.spec.ts",
"tests/scheduled-end-to-end/actionsMainPage-shard-1.spec.ts",
"tests/end-to-end/auto_login.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/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/scheduled-end-to-end/folders.spec.ts",
"tests/scheduled-end-to-end/inputComponent.spec.ts",
"tests/end-to-end/inputListComponent.spec.ts",
"tests/scheduled-end-to-end/intComponent.spec.ts",
"tests/end-to-end/keyPairListComponent.spec.ts",
"tests/scheduled-end-to-end/langflowShortcuts.spec.ts",
"tests/end-to-end/nestedComponent.spec.ts",
"tests/scheduled-end-to-end/promptModalComponent.spec.ts",
"tests/end-to-end/python_api_generation.spec.ts",
"tests/scheduled-end-to-end/textAreaModalComponent.spec.ts",
"tests/end-to-end/textInputOutput.spec.ts",
"tests/scheduled-end-to-end/toggleComponent.spec.ts",
"tests/end-to-end/tweaks_test.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" ]
"tests/core/saveComponents.spec.ts",
"tests/extended/actionsMainPage-shard-1.spec.ts",
"tests/core/auto_login.spec.ts",
"tests/core/unit/chatInputOutput.spec.ts",
"tests/extended/integrations/chatInputOutputUser-shard-2.spec.ts",
"tests/core/unit/codeAreaModalComponent.spec.ts",
"tests/extended/features/curlApiGeneration.spec.ts",
"tests/extended/features/deleteFlows.spec.ts",
"tests/extended/features/dragAndDrop.spec.ts",
"tests/core/unit/dropdownComponent.spec.ts",
"tests/core/unit/fileUploadComponent.spec.ts",
"tests/core/filterEdge.spec.ts",
"tests/core/unit/floatComponent.spec.ts",
"tests/extended/features/flowPage.spec.ts",
"tests/extended/features/flowSettings.spec.ts",
"tests/extended/regression/generalBugs-shard-0.spec.ts",
"tests/core/globalVariables.spec.ts",
"tests/core/group.spec.ts",
"tests/extended/folders.spec.ts",
"tests/core/unit/inputComponent.spec.ts",
"tests/core/inputListComponent.spec.ts",
"tests/core/unit/intComponent.spec.ts",
"tests/core/keyPairListComponent.spec.ts",
"tests/extended/features/langflowShortcuts.spec.ts",
"tests/core/nestedComponent.spec.ts",
"tests/core/unit/promptModalComponent.spec.ts",
"tests/core/python_api_generation.spec.ts",
"tests/core/unit/textAreaModalComponent.spec.ts",
"tests/core/textInputOutput.spec.ts",
"tests/core/unit/toggleComponent.spec.ts",
"tests/core/tweaks_test.spec.ts",
"tests/extended/features/twoEdges.spec.ts",
"tests/extended/features/userSettings.spec.ts",
"tests/core/store.spec.ts",
"tests/core/logs.spec.ts"
]
}
Loading