From 0603fa831ce58d59b297855d0d0c6b504dd8dcb4 Mon Sep 17 00:00:00 2001 From: Boris Arzentar Date: Wed, 12 Jun 2024 22:36:57 +0200 Subject: [PATCH] test: add github action running weaviate integration test --- .github/workflows/test_qdrant.yml | 2 +- .github/workflows/test_weaviate.yml | 62 +++++++++++++++++++ .../tests/test_weaviate.py | 0 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test_weaviate.yml rename tests/weaviate_test.py => cognee/tests/test_weaviate.py (100%) diff --git a/.github/workflows/test_qdrant.yml b/.github/workflows/test_qdrant.yml index 779b2a120..09857f5b9 100644 --- a/.github/workflows/test_qdrant.yml +++ b/.github/workflows/test_qdrant.yml @@ -18,7 +18,7 @@ jobs: name: docs changes uses: ./.github/workflows/get_docs_changes.yml - run_common: + run_qdrant_integration_test: name: test needs: get_docs_changes if: needs.get_docs_changes.outputs.changes_outside_docs == 'true' diff --git a/.github/workflows/test_weaviate.yml b/.github/workflows/test_weaviate.yml new file mode 100644 index 000000000..215c75bcc --- /dev/null +++ b/.github/workflows/test_weaviate.yml @@ -0,0 +1,62 @@ +name: common + +on: + pull_request: + branches: + - main + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + RUNTIME__LOG_LEVEL: ERROR + +jobs: + get_docs_changes: + name: docs changes + uses: ./.github/workflows/get_docs_changes.yml + + run_weaviate_integration_test: + name: test + needs: get_docs_changes + if: needs.get_docs_changes.outputs.changes_outside_docs == 'true' + runs-on: macos-latest + + defaults: + run: + shell: bash + + steps: + - name: Check out + uses: actions/checkout@v2 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: 3.11 + + - name: Install Poetry + uses: snok/install-poetry@v1.3.2 + with: + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true + + - name: Install dependencies + run: poetry install --no-interaction + + - name: Create .cognee_system directory and print path + run: | + mkdir .cognee_system + echo $(pwd)/.cognee_system + + - name: Run default Weaviate + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + LLM_API_KEY: ${{ secrets.OPENAI_API_KEY }} + VECTOR_DB_URL: ${{ secrets.WEAVIATE_API_URL }} + VECTOR_DB_KEY: ${{ secrets.WEAVIATE_API_KEY }} + ENV: 'dev' + run: poetry run python ./cognee/tests/test_weaviate.py diff --git a/tests/weaviate_test.py b/cognee/tests/test_weaviate.py similarity index 100% rename from tests/weaviate_test.py rename to cognee/tests/test_weaviate.py