Skip to content

Import for text pipeline #48

Import for text pipeline

Import for text pipeline #48

Workflow file for this run

name: Backend Tests
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches:
- main
- mwp_v1
pull_request:
paths:
- "backend/**"
- ".github/**"
- "docker/**"
# Allows you to run this workflow manually from the Actions tab
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: true
jobs:
log-the-inputs:
runs-on: ubuntu-latest
steps:
- name: Log the inputs
env:
LEVEL: ${{ inputs.logLevel }}
TAGS: ${{ inputs.tags }}
ENVIRONMENT: ${{ inputs.environment }}
run: |
echo "Log level: $LEVEL"
echo "Tags: $TAGS"
echo "Environment: $ENVIRONMENT"
run-tests:
runs-on: ubuntu-latest
env:
API_PRODUCTION_WORKERS: 1
# disable backend and frontend
COMPOSE_PROFILES: "background"
RAY_ENABLED: False
OLLAMA_ENABLED: False
POSTGRES_DB: dats-test
JWT_SECRET: ${{ secrets.JWT_SECRET }}
steps:
- name: Set Swap Space to 10GB
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 10
- uses: actions/checkout@v3
- name: Start Docker Containers
working-directory: docker
run: |
./setup-folders.sh
cp .env.example .env
chmod -R a+rwx backend_repo/ models_cache/ spacy_models/
python monkey_patch_docker_compose_for_backend_tests.py --disable_ray --disable_ollama
export GID=$(id -g)
docker compose -f compose-test.yml up -d --quiet-pull
echo Waiting for containers to start...
sleep 30
- name: Run tests
working-directory: docker
run: |
export RAY_ENABLED=False
docker compose -f compose-test.yml run -i dats-backend-api /opt/envs/dats/bin/python -m pytest