From b0d1b92cce8705a60e637b650727a20c82d58a02 Mon Sep 17 00:00:00 2001 From: Boris Arzentar Date: Sat, 1 Nov 2025 12:39:27 +0100 Subject: [PATCH] test: move deletion tests to e2e_tests --- .github/workflows/e2e_tests.yml | 107 ++++++++++++++++++ .../test_different_operating_systems.yml | 67 ----------- 2 files changed, 107 insertions(+), 67 deletions(-) diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index 70a4b56e6..bfa596855 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -9,6 +9,14 @@ on: required: false type: string default: '3.11.x' + supported-python-versions: + required: false + type: string + default: '["3.10.x", "3.12.x", "3.13.x"]' + supported-operating-systems: + required: false + type: string + default: '["ubuntu-22.04", "macos-15", "windows-latest"]' secrets: LLM_MODEL: required: true @@ -239,6 +247,105 @@ jobs: EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} run: uv run python ./cognee/tests/test_permissions.py + test-delete-permission: + name: Test delete permission assigned from dataset owner + runs-on: ubuntu-22.04 + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Cognee Setup + uses: ./.github/actions/cognee_setup + with: + python-version: '3.11.x' + + - name: Dependencies already installed + run: echo "Dependencies already installed in setup" + + - name: Run delete persmission test + env: + ENV: 'dev' + LLM_MODEL: ${{ secrets.LLM_MODEL }} + LLM_ENDPOINT: ${{ secrets.LLM_ENDPOINT }} + LLM_API_KEY: ${{ secrets.LLM_API_KEY }} + LLM_API_VERSION: ${{ secrets.LLM_API_VERSION }} + EMBEDDING_MODEL: ${{ secrets.EMBEDDING_MODEL }} + EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} + EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} + EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} + run: uv run python ./cognee/tests/test_delete_permission.py + + test-deletion-on-default-graph: + name: Delete default graph data test ${{ matrix.python-version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: ${{ fromJSON(inputs.supported-python-versions) }} + os: ${{ fromJSON(inputs.supported-operating-systems) }} + fail-fast: false + steps: + - name: Check out + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Cognee Setup + uses: ./.github/actions/cognee_setup + with: + python-version: ${{ matrix.python-version }} + + - name: Path setup + if: ${{ matrix.os }} == 'windows-latest' + shell: bash + run: | + PATH=$(printf '%s' "$PATH" | tr ':' $'\n' | grep -vi '/git/usr/bin' | paste -sd: -) + export PATH + + - name: Run deletion on default graph + env: + ENV: 'dev' + LLM_MODEL: ${{ secrets.LLM_MODEL }} + LLM_ENDPOINT: ${{ secrets.LLM_ENDPOINT }} + LLM_API_KEY: ${{ secrets.LLM_API_KEY }} + LLM_API_VERSION: ${{ secrets.LLM_API_VERSION }} + EMBEDDING_MODEL: ${{ secrets.EMBEDDING_MODEL }} + EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} + EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} + EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} + run: uv run python ./cognee/tests/test_delete_default_graph.py + + test-deletion-on-custom-graph: + name: Delete custom graph data test ${{ matrix.python-version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: ${{ fromJSON(inputs.supported-python-versions) }} + os: ${{ fromJSON(inputs.supported-operating-systems) }} + fail-fast: false + steps: + - name: Check out + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Cognee Setup + uses: ./.github/actions/cognee_setup + with: + python-version: ${{ matrix.python-version }} + + - name: Run deletion on custom graph + env: + ENV: 'dev' + LLM_MODEL: ${{ secrets.LLM_MODEL }} + LLM_ENDPOINT: ${{ secrets.LLM_ENDPOINT }} + LLM_API_KEY: ${{ secrets.LLM_API_KEY }} + LLM_API_VERSION: ${{ secrets.LLM_API_VERSION }} + EMBEDDING_MODEL: ${{ secrets.EMBEDDING_MODEL }} + EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} + EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} + EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} + run: uv run python ./cognee/tests/test_delete_custom_graph.py + test-graph-edges: name: Test graph edge ingestion runs-on: ubuntu-22.04 diff --git a/.github/workflows/test_different_operating_systems.yml b/.github/workflows/test_different_operating_systems.yml index f1c9614ae..75c84bb78 100644 --- a/.github/workflows/test_different_operating_systems.yml +++ b/.github/workflows/test_different_operating_systems.yml @@ -177,70 +177,3 @@ jobs: run: | cd dist pip install *.whl - - run-deletion-on-default-graph-test: - name: Delete default graph data test ${{ matrix.python-version }} on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - python-version: ${{ fromJSON(inputs.python-versions) }} - os: ${{ fromJSON(inputs.os) }} - fail-fast: false - steps: - - name: Check out - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Cognee Setup - uses: ./.github/actions/cognee_setup - with: - python-version: ${{ matrix.python-version }} - - - name: Path setup - if: ${{ matrix.os }} == 'windows-latest' - shell: bash - run: | - PATH=$(printf '%s' "$PATH" | tr ':' $'\n' | grep -vi '/git/usr/bin' | paste -sd: -) - export PATH - - - name: Run Deletion on Default Graph Tests - env: - ENV: 'dev' - LLM_API_KEY: ${{ secrets.OPENAI_API_KEY }} # Test needs OpenAI endpoint to handle multimedia - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - EMBEDDING_MODEL: ${{ secrets.EMBEDDING_MODEL }} - EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} - EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} - EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: uv run python ./cognee/tests/test_delete_default_graph.py - - run-deletion-on-custom-graph-test: - name: Delete custom graph data test ${{ matrix.python-version }} on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - python-version: ${{ fromJSON(inputs.python-versions) }} - os: ${{ fromJSON(inputs.os) }} - fail-fast: false - steps: - - name: Check out - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Cognee Setup - uses: ./.github/actions/cognee_setup - with: - python-version: ${{ matrix.python-version }} - - - name: Run Hard Deletion Test - env: - ENV: 'dev' - LLM_API_KEY: ${{ secrets.OPENAI_API_KEY }} # Test needs OpenAI endpoint to handle multimedia - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - EMBEDDING_MODEL: ${{ secrets.EMBEDDING_MODEL }} - EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} - EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} - EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: uv run python ./cognee/tests/test_delete_custom_graph.py