quivr/.github/workflows/backend-tests.yml
Noe 303ba72028
feat: Introduce repository pattern to prepare adding other database providers (#646)
* add sqlalchemy models

* add neon settings

* add insert brain

* abstract supabase from Brain class

* abstract supabase from Brain class

* abstract supabase from /models

* update Database to Repository

* update neon_tables to pg_tables

* update chat, api-key and message

* update vector class

* update settings

* update env vars for test

* Update backend-tests.yml

* fix test

* fix fetch_user_requests_count()

* fix fetch_user_requests_count()

* fix increment_user_request_count

* fix increment_user_request_count

* fix asset upload_response message

* fix pyright

* fix brain_subscription

* fix brain_subscription

* fix brain_subscription

* fix get user request stat

* update create_brain_user

* add delete brain vector and user

* add delete brain vector and user

* correctly call function

---------

Co-authored-by: Noé Pion <noe.pion@onfido.com>
Co-authored-by: raoufchebri <raouf@chebri.com>
Co-authored-by: Stan Girard <girard.stanislas@gmail.com>
2023-08-01 23:03:47 +02:00

71 lines
1.8 KiB
YAML

name: Backend Tests
on:
push:
branches: [main]
paths:
- 'backend/core/**'
pull_request:
branches: [main]
paths:
- 'backend/core/**'
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
tags:
description: 'Test scenario tags'
required: false
type: boolean
environment:
description: 'Environment to run tests against'
type: environment
required: false
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend/core
environment: preview
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install pyright
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
env:
SUPABASE_URL: ${{secrets.SUPABASE_URL}}
SUPABASE_SERVICE_KEY: ${{secrets.SUPABASE_SERVICE_KEY}}
PG_DATABASE_URL: ${{secrets.PG_DATABASE_URL}}
OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}}
ANTHROPIC_API_KEY: ${{secrets.ANTHROPIC_API_KEY}}
JWT_SECRET_KEY: ${{secrets.JWT_SECRET_KEY}}
CI_TEST_API_KEY: ${{secrets.CI_TEST_API_KEY}}
run: |
python -m pytest tests/
- name: Static type checking with pyright
run: |
pyright