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: Categorize Tests into CI and Scheduled Groups #3391

Merged
merged 23 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c6173ef
categoring tests
Cristhianzl Aug 16, 2024
c7649e5
✨ (actionsMainPage-shard-1.spec.ts): Add end-to-end tests for selecti…
Cristhianzl Aug 16, 2024
bf77ca5
📝 (frontend/tsconfig.json): update file paths in include section to m…
Cristhianzl Aug 16, 2024
9d10fb9
🔧 (typescript_test.yml): update path in the command to change directo…
Cristhianzl Aug 16, 2024
561f426
add yml configuration to choose folder to run CI
Cristhianzl Aug 16, 2024
b5b2311
🔧 (ci.yml): Fix formatting issues and add support for running tests i…
Cristhianzl Aug 16, 2024
60cd1e2
Merge branch 'main' into cz/test-category
Cristhianzl Aug 16, 2024
29463f4
♻️ (typescript_test.yml): refactor matrix values for shardIndex and s…
Cristhianzl Aug 16, 2024
0940d14
Merge branch 'cz/test-category' of https://github.com/langflow-ai/lan…
Cristhianzl Aug 16, 2024
5273e39
categoring tests
Cristhianzl Aug 16, 2024
f63bcd7
✨ (actionsMainPage-shard-1.spec.ts): Add end-to-end tests for selecti…
Cristhianzl Aug 16, 2024
777ddf4
📝 (frontend/tsconfig.json): update file paths in include section to m…
Cristhianzl Aug 16, 2024
bda6242
🔧 (typescript_test.yml): update path in the command to change directo…
Cristhianzl Aug 16, 2024
e9b7af0
add yml configuration to choose folder to run CI
Cristhianzl Aug 16, 2024
b3e3eb3
🔧 (ci.yml): Fix formatting issues and add support for running tests i…
Cristhianzl Aug 16, 2024
8696ff7
♻️ (typescript_test.yml): refactor matrix values for shardIndex and s…
Cristhianzl Aug 16, 2024
264a6d1
🐛 (fileUploadComponent.spec.ts): fix file path for file upload to cor…
Cristhianzl Aug 16, 2024
8e2ebb6
Merge branch 'cz/test-category' of https://github.com/langflow-ai/lan…
Cristhianzl Aug 16, 2024
0aaf755
changing test_folder
Cristhianzl Aug 16, 2024
18b0140
Merge branch 'main' into cz/test-category
Cristhianzl Aug 16, 2024
ecbea4a
✨ (fileUploadComponent.spec.ts): update file path for file upload tes…
Cristhianzl Aug 16, 2024
ce1057b
Merge branch 'cz/test-category' of https://github.com/langflow-ai/lan…
Cristhianzl Aug 16, 2024
fc41f64
fix input on playwright command
Cristhianzl Aug 16, 2024
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
16 changes: 12 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 }}"
Expand All @@ -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:
Expand All @@ -104,4 +112,4 @@ jobs:
echo $JOBS_JSON
echo $RESULTS_JSON
echo "Exiting with $EXIT_CODE"
exit $EXIT_CODE
exit $EXIT_CODE
43 changes: 16 additions & 27 deletions .github/workflows/typescript_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 }}
Expand Down Expand Up @@ -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()
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/frontend/tests/end-to-end/filterEdge-shard-0.spec.ts
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
4 changes: 3 additions & 1 deletion src/frontend/tests/end-to-end/filterSidebar.spec.ts
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
4 changes: 3 additions & 1 deletion src/frontend/tests/end-to-end/globalVariables.spec.ts
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
Original file line number Diff line number Diff line change
@@ -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 }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
44 changes: 22 additions & 22 deletions src/frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
Expand Down