Skip to content

End-to-End Tests

End-to-End Tests #37

Workflow file for this run

name: End-to-End Tests
on:
workflow_dispatch:
workflow_run:
workflows: ["Build Images"]
types:
- completed
env:
POSTGRES_HOST: localhost
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: ctk
POSTGRES_PORT: 5432
POSTGRES_SSL: false
DEVELOPMENT_USER: [email protected]
AZURE_FUNCTION_PYTHON_URL: http://localhost:8000
jobs:
e2e:
runs-on: ubuntu-latest
services:
api:
image: cliniciantoolkit.azurecr.io/ctk-functions:latest
credentials:
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
ports:
- 8000:8000
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CLOAI_SERVICE_URL: http://cloai-service:8000/v1
CLOAI_MODEL: sonnet-3.5-v2
AZURE_OPENAI_API_KEY: unused
AZURE_OPENAI_LLM_DEPLOYMENT: unused
AZURE_OPENAI_ENDPOINT: unusued
LANGUAGE_TOOL_URL: http://languagetool:8010/v2
REDCAP_API_TOKEN: unused
cloai-service:
image: cliniciantoolkit.azurecr.io/cloai-service:latest
credentials:
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
ports:
- 8001:8000
env:
CONFIG_JSON: '{"clients":{"sonnet-3.5-v2": { "type": "anthropic", "model": "anthropic.claude-3-5-sonnet-20241022-v2:0", "aws_access_key": ${{ secrets.AWS_ACCESS_KEY_ID }}, "aws_secret_key": ${{ secrets.AWS_SECRET_ACCESS_KEY }}, "region": "us-west-2"}}}'
options: >-
--health-cmd "curl -f http://0.0.0.0:8001/v1/health || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5
languagetool:
image: erikvl87/languagetool:6.5
ports:
- 8010:8010
postgres:
image: postgres:latest
ports:
- 5432:5432
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ env.POSTGRES_DB }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 10
steps:
- name: Checkout Frontend
uses: actions/checkout@main
with:
repository: childmindresearch/ctk-webapp
- name: Initialize PostgreSQL
env:
PGPASSWORD: ${{ env.POSTGRES_PASSWORD }}
run: psql -h localhost -U ${POSTGRES_USER} -d ctk -f ./e2e/init.sql
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22.4.x
cache: npm
cache-dependency-path: package-lock.json
- name: Install dependencies
run: |
npm install --legacy-peer-deps
npx playwright install chromium
- name: Run tests
run: |
npm run test:integration
- name: Upload test artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: video-files
path: test-results/**/*.webm