fix: wait for postgres to be ready before tests

This commit is contained in:
Boris Arzentar 2024-08-06 16:11:48 +02:00
parent e492a18987
commit ed6e8eb0d2
5 changed files with 28 additions and 8 deletions

View file

@ -98,6 +98,12 @@ jobs:
mkdir .cognee_system
echo $(pwd)/.cognee_system
- name: Wait for PostgreSQL to be ready
run: |
echo "Waiting for PostgreSQL to be ready..."
until pg_isready -h localhost -p 5432 -U cognee; do
sleep 1
done
- name: Run tests
run: poetry run pytest tests/

View file

@ -63,13 +63,6 @@ jobs:
virtualenvs-in-project: true
installer-parallel: true
- name: Wait for PostgreSQL to be ready
run: |
echo "Waiting for PostgreSQL to be ready..."
until pg_isready -h localhost -p 5432 -U cognee; do
sleep 1
done
- name: Install dependencies
run: poetry install --no-interaction
@ -78,6 +71,13 @@ jobs:
mkdir .cognee_system
echo $(pwd)/.cognee_system
- name: Wait for PostgreSQL to be ready
run: |
echo "Waiting for PostgreSQL to be ready..."
until pg_isready -h localhost -p 5432 -U cognee; do
sleep 1
done
- name: Run default Neo4j
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

View file

@ -71,6 +71,13 @@ jobs:
mkdir .cognee_system
echo $(pwd)/.cognee_system
- name: Wait for PostgreSQL to be ready
run: |
echo "Waiting for PostgreSQL to be ready..."
until pg_isready -h localhost -p 5432 -U cognee; do
sleep 1
done
- name: Run default Qdrant
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

View file

@ -71,6 +71,12 @@ jobs:
mkdir .cognee_system
echo $(pwd)/.cognee_system
- name: Wait for PostgreSQL to be ready
run: |
echo "Waiting for PostgreSQL to be ready..."
until pg_isready -h localhost -p 5432 -U cognee; do
sleep 1
- name: Run default Weaviate
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

View file

@ -21,7 +21,8 @@ class Neo4jAdapter(GraphDBInterface):
):
self.driver = driver or AsyncGraphDatabase.driver(
graph_database_url,
auth = (graph_database_username, graph_database_password)
auth = (graph_database_username, graph_database_password),
max_connection_lifetime = 120
)
async def close(self) -> None: