fix: wait for postgres to be ready before tests
This commit is contained in:
parent
e492a18987
commit
ed6e8eb0d2
5 changed files with 28 additions and 8 deletions
6
.github/workflows/test_common.yml
vendored
6
.github/workflows/test_common.yml
vendored
|
|
@ -98,6 +98,12 @@ jobs:
|
||||||
mkdir .cognee_system
|
mkdir .cognee_system
|
||||||
echo $(pwd)/.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
|
- name: Run tests
|
||||||
run: poetry run pytest tests/
|
run: poetry run pytest tests/
|
||||||
|
|
|
||||||
14
.github/workflows/test_neo4j.yml
vendored
14
.github/workflows/test_neo4j.yml
vendored
|
|
@ -63,13 +63,6 @@ jobs:
|
||||||
virtualenvs-in-project: true
|
virtualenvs-in-project: true
|
||||||
installer-parallel: 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
|
- name: Install dependencies
|
||||||
run: poetry install --no-interaction
|
run: poetry install --no-interaction
|
||||||
|
|
||||||
|
|
@ -78,6 +71,13 @@ jobs:
|
||||||
mkdir .cognee_system
|
mkdir .cognee_system
|
||||||
echo $(pwd)/.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
|
- name: Run default Neo4j
|
||||||
env:
|
env:
|
||||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||||
|
|
|
||||||
7
.github/workflows/test_qdrant.yml
vendored
7
.github/workflows/test_qdrant.yml
vendored
|
|
@ -71,6 +71,13 @@ jobs:
|
||||||
mkdir .cognee_system
|
mkdir .cognee_system
|
||||||
echo $(pwd)/.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
|
- name: Run default Qdrant
|
||||||
env:
|
env:
|
||||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||||
|
|
|
||||||
6
.github/workflows/test_weaviate.yml
vendored
6
.github/workflows/test_weaviate.yml
vendored
|
|
@ -71,6 +71,12 @@ jobs:
|
||||||
mkdir .cognee_system
|
mkdir .cognee_system
|
||||||
echo $(pwd)/.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
|
- name: Run default Weaviate
|
||||||
env:
|
env:
|
||||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,8 @@ class Neo4jAdapter(GraphDBInterface):
|
||||||
):
|
):
|
||||||
self.driver = driver or AsyncGraphDatabase.driver(
|
self.driver = driver or AsyncGraphDatabase.driver(
|
||||||
graph_database_url,
|
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:
|
async def close(self) -> None:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue