-
Notifications
You must be signed in to change notification settings - Fork 1.4k
58 lines (50 loc) · 1.67 KB
/
docker-integration-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
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: "Setup Python, Poetry and Dependencies"
uses: packetcoders/action-setup-cache-python-poetry@main
with:
python-version: "3.11"
poetry-version: "1.7.1"
install-args: "-E dev"
- name: Set permissions for log directory
run: |
mkdir -p /home/runner/.memgpt/logs
sudo chown -R $USER:$USER /home/runner/.memgpt/logs
chmod -R 755 /home/runner/.memgpt/logs
- name: Build and run docker dev server
env:
MEMGPT_PG_DB: memgpt
MEMGPT_PG_USER: memgpt
MEMGPT_PG_PASSWORD: memgpt
MEMGPT_PG_PORT: 8888
MEMGPT_SERVER_PASS: test_server_token
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: docker compose -f dev-compose.yaml up --build -d
- name: Wait for service
run: bash scripts/wait_for_service.sh http://localhost:8083 -- echo "Service is ready"
- name: Run tests with pytest
env:
MEMGPT_PG_DB: memgpt
MEMGPT_PG_USER: memgpt
MEMGPT_PG_PASSWORD: memgpt
MEMGPT_PG_PORT: 8888
MEMGPT_SERVER_PASS: test_server_token
MEMGPT_SERVER_URL: http://localhost:8083
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
PYTHONPATH: ${{ github.workspace }}:${{ env.PYTHONPATH }}
run: poetry run pytest -s tests/test_client.py
- name: Print docker logs if tests fail
if: failure()
run: |
echo "Printing Docker Logs..."
docker compose -f dev-compose.yaml logs