forked from langfuse/langfuse
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (63 loc) · 2.31 KB
/
pr-open-api-e2e.yml
File metadata and controls
75 lines (63 loc) · 2.31 KB
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
name: PR Open API E2E
on:
workflow_dispatch:
pull_request:
branches:
- "**"
types:
- opened
- reopened
- ready_for_review
- synchronize
concurrency:
group: pr-open-api-e2e-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
api-e2e-flow:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set deterministic bootstrap keys for tests
run: |
echo "LANGFUSE_HOST=http://localhost:3000" >> "$GITHUB_ENV"
echo "LANGFUSE_PUBLIC_KEY=pk-lf-local-tracing-project" >> "$GITHUB_ENV"
echo "LANGFUSE_SECRET_KEY=sk-lf-local-tracing-project-secret" >> "$GITHUB_ENV"
echo "LANGFUSE_E2E_TIMEOUT_SECONDS=60" >> "$GITHUB_ENV"
- name: Build and start stack from docker-compose.yml
run: |
docker compose -f docker-compose.yml up -d --build --wait --wait-timeout 360
- name: Wait for web and worker health endpoints
run: |
curl --retry 30 --retry-delay 2 --retry-all-errors --silent --show-error --fail \
http://localhost:3000/api/public/health
curl --retry 30 --retry-delay 2 --retry-all-errors --silent --show-error --fail \
http://localhost:3030/api/health
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install pytest
run: |
python -m pip install --upgrade pip
pip install pytest
- name: Run basic API flow e2e tests
run: |
python -m pytest tests/e2e/test_public_ingestion_api.py -k "basic_flow or ingestion_accepts_valid_batch" -q
- name: Dump compose logs on failure
if: failure()
run: |
docker compose -f docker-compose.yml ps
docker compose -f docker-compose.yml logs --no-color > /tmp/pr-open-api-e2e.log || true
- name: Upload compose logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: pr-open-api-e2e-logs-${{ github.run_id }}-${{ github.run_attempt }}
path: /tmp/pr-open-api-e2e.log
if-no-files-found: ignore
- name: Shutdown compose stack
if: always()
run: |
docker compose -f docker-compose.yml down -v