-
Notifications
You must be signed in to change notification settings - Fork 131
81 lines (70 loc) · 2.56 KB
/
sdk-e2e-tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: SDK E2E Tests
run-name: "SDK E2E Tests ${{ github.ref_name }} by @${{ github.actor }}"
on:
workflow_dispatch:
pull_request:
paths:
- 'sdks/python/**'
- 'apps/opik-backend/**'
push:
branches:
- 'main'
paths:
- 'sdks/python/**'
- 'apps/opik-backend/**'
jobs:
run-e2e:
name: SDK E2E Tests ${{matrix.python_version}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup Python ${{matrix.python_version}}
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python_version}}
- name: Run latest Opik server
env:
OPIK_USAGE_REPORT_ENABLED: false
run: |
cd deployment/docker-compose
docker compose up -d --build
- name: Check Opik server availability
shell: bash
run: |
chmod +x ${{ github.workspace }}/tests_end_to_end/installer_utils/*.sh
cd ${{ github.workspace }}/deployment/docker-compose
echo "Check Docker pods are up"
${{ github.workspace }}/tests_end_to_end/installer_utils/check_docker_compose_pods.sh
echo "Check backend health"
${{ github.workspace }}/tests_end_to_end/installer_utils/check_backend.sh
- name: Install opik SDK
run: |
cd ${{ github.workspace }}/sdks/python
pip install -r tests/test_requirements.txt
pip install .
- name: Run tests
run: |
cd ${{ github.workspace }}/sdks/python
export OPIK_URL_OVERRIDE=http://localhost:5173/api
export OPIK_CONSOLE_LOGGING_LEVEL=DEBUG
pytest tests/e2e -vv
- name: Keep BE log in case of failure
if: failure()
run: |
docker logs opik-backend-1 > ${{ github.workspace }}/opik-backend_p${{matrix.python_version}}.log
- name: Attach BE log
if: failure()
uses: actions/upload-artifact@v4
with:
name: opik-backend-log-p${{matrix.python_version}}
path: ${{ github.workspace }}/opik-backend_p${{matrix.python_version}}.log
- name: Stop opik server
if: always()
run: |
cd ${{ github.workspace }}/deployment/docker-compose
docker compose down