feat: adds subprocess test frame just to test the GA
This commit is contained in:
parent
31cb4a3698
commit
fe41de7827
3 changed files with 120 additions and 0 deletions
67
.github/workflows/concurrent_subprocess_tests.yml
vendored
Normal file
67
.github/workflows/concurrent_subprocess_tests.yml
vendored
Normal file
|
|
@ -0,0 +1,67 @@
|
||||||
|
name: Concurrent Subprocess Access Tests
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
databases:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: "all"
|
||||||
|
description: "Which vector databases to test (comma-separated list or 'all')"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
run_concurrent_subprocess_access_test:
|
||||||
|
name: Concurrent Subprocess access test
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
if: ${{ inputs.databases == 'all' || contains(inputs.databases, 'kuzu/pgvector/postgres') }}
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: pgvector/pgvector:pg17
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: cognee
|
||||||
|
POSTGRES_PASSWORD: cognee
|
||||||
|
POSTGRES_DB: cognee_db
|
||||||
|
options: >-
|
||||||
|
--health-cmd pg_isready
|
||||||
|
--health-interval 10s
|
||||||
|
--health-timeout 5s
|
||||||
|
--health-retries 5
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
steps:
|
||||||
|
- name: Check out
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Cognee Setup
|
||||||
|
uses: ./.github/actions/cognee_setup
|
||||||
|
with:
|
||||||
|
python-version: ${{ inputs.python-version }}
|
||||||
|
extra-dependencies: "postgres"
|
||||||
|
|
||||||
|
- name: Dependencies already installed
|
||||||
|
run: echo "Dependencies already installed in setup"
|
||||||
|
|
||||||
|
- name: Run Concurrent subprocess access test (Kuzu/Lancedb/Postgres)
|
||||||
|
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 }}
|
||||||
|
GRAPH_DATABASE_PROVIDER: 'kuzu'
|
||||||
|
DB_PROVIDER: 'postgres'
|
||||||
|
DB_NAME: 'cognee_db'
|
||||||
|
DB_HOST: '127.0.0.1'
|
||||||
|
DB_PORT: 5432
|
||||||
|
DB_USERNAME: cognee
|
||||||
|
DB_PASSWORD: cognee
|
||||||
|
run: uv run python ./cognee/tests/test_concurrent_subprocess_access.py
|
||||||
5
.github/workflows/test_suites.yml
vendored
5
.github/workflows/test_suites.yml
vendored
|
|
@ -22,6 +22,11 @@ jobs:
|
||||||
uses: ./.github/workflows/basic_tests.yml
|
uses: ./.github/workflows/basic_tests.yml
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
|
concurrent-subprocess-tests:
|
||||||
|
name: Concurrent subprocess tests
|
||||||
|
uses: ./.github/workflows/concurrent_subprocess_tests.yml
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
e2e-tests:
|
e2e-tests:
|
||||||
name: End-to-End Tests
|
name: End-to-End Tests
|
||||||
uses: ./.github/workflows/e2e_tests.yml
|
uses: ./.github/workflows/e2e_tests.yml
|
||||||
|
|
|
||||||
48
cognee/tests/test_concurrent_subprocess_access.py
Normal file
48
cognee/tests/test_concurrent_subprocess_access.py
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
import os
|
||||||
|
import asyncio
|
||||||
|
import cognee
|
||||||
|
import pathlib
|
||||||
|
|
||||||
|
from cognee.infrastructure.databases.graph import get_graph_engine
|
||||||
|
from collections import Counter
|
||||||
|
from cognee.modules.users.methods import get_default_user
|
||||||
|
from cognee.shared.logging_utils import get_logger
|
||||||
|
|
||||||
|
logger = get_logger()
|
||||||
|
|
||||||
|
|
||||||
|
async def test_concurrent_subprocess_access():
|
||||||
|
data_directory_path = str(
|
||||||
|
pathlib.Path(
|
||||||
|
os.path.join(pathlib.Path(__file__).parent, ".data_storage/concurrent_tasks")
|
||||||
|
).resolve()
|
||||||
|
)
|
||||||
|
cognee_directory_path = str(
|
||||||
|
pathlib.Path(
|
||||||
|
os.path.join(pathlib.Path(__file__).parent, ".cognee_system/concurrent_tasks")
|
||||||
|
).resolve()
|
||||||
|
)
|
||||||
|
|
||||||
|
cognee.config.data_root_directory(data_directory_path)
|
||||||
|
cognee.config.system_root_directory(cognee_directory_path)
|
||||||
|
|
||||||
|
await cognee.prune.prune_data()
|
||||||
|
await cognee.prune.prune_system(metadata=True)
|
||||||
|
|
||||||
|
basic_nested_edges = ["is_a", "is_part_of", "contains", "made_from"]
|
||||||
|
|
||||||
|
entity_to_entity_edges = ["likes", "prefers", "watches"]
|
||||||
|
|
||||||
|
text1 = "Dave watches Dexter Resurrection"
|
||||||
|
text2 = "Ana likes apples"
|
||||||
|
text3 = "Bob prefers Cognee over other solutions"
|
||||||
|
|
||||||
|
await cognee.add([text1, text2, text3], dataset_name="edge_ingestion_test")
|
||||||
|
|
||||||
|
user = await get_default_user()
|
||||||
|
|
||||||
|
await cognee.cognify(["edge_ingestion_test"], user=user)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
asyncio.run(test_concurrent_subprocess_access())
|
||||||
Loading…
Add table
Reference in a new issue