Skip to content

Commit cec19f1

Browse files
Remove test
1 parent b74d819 commit cec19f1

5 files changed

Lines changed: 53 additions & 113 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,18 @@ jobs:
1818
- name: Checkout code
1919
uses: actions/checkout@v4
2020

21-
- name: Run tests
22-
env:
23-
LOGFIRE_TOKEN: ${{ secrets.LOGFIRE_TOKEN }}
24-
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
25-
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
26-
SUPABASE_DB_URL: ${{ secrets.SUPABASE_DB_URL }}
27-
run: make test
28-
29-
- name: Show container logs on failure
30-
if: failure()
21+
- name: Setup Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.11'
25+
26+
- name: Install dependencies
3127
run: |
32-
echo "=== API Logs ==="
33-
docker compose logs api
34-
echo ""
35-
echo "=== Worker Logs ==="
36-
docker compose logs worker
37-
echo ""
38-
echo "=== Redis Logs ==="
39-
docker compose logs redis
28+
pip install -e .
29+
pip install pytest
30+
31+
- name: Run tests
32+
run: pytest tests/test_models.py -v
4033

4134
deploy:
4235
name: Deploy

.github/workflows/test.yml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,15 @@ jobs:
1515
- name: Checkout code
1616
uses: actions/checkout@v4
1717

18-
- name: Run tests
19-
env:
20-
LOGFIRE_TOKEN: ${{ secrets.LOGFIRE_TOKEN }}
21-
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
22-
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
23-
SUPABASE_DB_URL: ${{ secrets.SUPABASE_DB_URL }}
24-
run: make test
18+
- name: Setup Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.11'
2522

26-
- name: Show container logs on failure
27-
if: failure()
23+
- name: Install dependencies
2824
run: |
29-
echo "=== API Logs ==="
30-
docker compose logs api
31-
echo ""
32-
echo "=== Worker Logs ==="
33-
docker compose logs worker
34-
echo ""
35-
echo "=== Redis Logs ==="
36-
docker compose logs redis
25+
pip install -e .
26+
pip install pytest
27+
28+
- name: Run tests
29+
run: pytest tests/test_models.py -v

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ lint:
1717
ruff check --fix .
1818

1919
test:
20-
docker compose --profile test up --build --exit-code-from test test || (docker compose logs api && docker compose logs worker && exit 1)
20+
pytest tests/test_models.py -v
2121

2222
clean:
2323
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true

docker-compose.yml

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
services:
2+
postgres:
3+
image: postgres:15
4+
environment:
5+
POSTGRES_USER: postgres
6+
POSTGRES_PASSWORD: postgres
7+
POSTGRES_DB: postgres
8+
ports:
9+
- "5432:5432"
10+
healthcheck:
11+
test: ["CMD", "pg_isready", "-U", "postgres"]
12+
interval: 5s
13+
timeout: 3s
14+
retries: 5
15+
216
redis:
317
image: redis:7
418
ports:
@@ -15,9 +29,9 @@ services:
1529
ports:
1630
- "8000:8000"
1731
environment:
18-
SUPABASE_URL: ${SUPABASE_URL:-http://host.docker.internal:54321}
19-
SUPABASE_KEY: ${SUPABASE_KEY}
20-
SUPABASE_DB_URL: postgresql://postgres:postgres@host.docker.internal:54322/postgres
32+
SUPABASE_URL: ${SUPABASE_URL:-http://postgres:5432}
33+
SUPABASE_KEY: ${SUPABASE_KEY:-test-key}
34+
SUPABASE_DB_URL: ${SUPABASE_DB_URL:-postgresql://postgres:postgres@postgres:5432/postgres}
2135
REDIS_URL: redis://redis:6379/0
2236
CELERY_BROKER_URL: redis://redis:6379/0
2337
CELERY_RESULT_BACKEND: redis://redis:6379/1
@@ -26,6 +40,8 @@ services:
2640
volumes:
2741
- ./src:/app/src
2842
depends_on:
43+
postgres:
44+
condition: service_healthy
2945
redis:
3046
condition: service_healthy
3147
healthcheck:
@@ -39,25 +55,28 @@ services:
3955
build: .
4056
command: celery -A policyengine_api.tasks.celery_app worker --loglevel=info
4157
environment:
42-
SUPABASE_URL: ${SUPABASE_URL:-http://host.docker.internal:54321}
43-
SUPABASE_KEY: ${SUPABASE_KEY}
44-
SUPABASE_DB_URL: postgresql://postgres:postgres@host.docker.internal:54322/postgres
58+
SUPABASE_URL: ${SUPABASE_URL:-http://postgres:5432}
59+
SUPABASE_KEY: ${SUPABASE_KEY:-test-key}
60+
SUPABASE_DB_URL: ${SUPABASE_DB_URL:-postgresql://postgres:postgres@postgres:5432/postgres}
4561
REDIS_URL: redis://redis:6379/0
4662
CELERY_BROKER_URL: redis://redis:6379/0
4763
CELERY_RESULT_BACKEND: redis://redis:6379/1
4864
LOGFIRE_TOKEN: ${LOGFIRE_TOKEN}
4965
volumes:
5066
- ./src:/app/src
5167
depends_on:
52-
- redis
68+
postgres:
69+
condition: service_healthy
70+
redis:
71+
condition: service_healthy
5372

5473
test:
5574
build: .
5675
command: pytest tests/ -v
5776
environment:
58-
SUPABASE_URL: ${SUPABASE_URL:-http://host.docker.internal:54321}
59-
SUPABASE_KEY: ${SUPABASE_KEY}
60-
SUPABASE_DB_URL: postgresql://postgres:postgres@host.docker.internal:54322/postgres
77+
SUPABASE_URL: ${SUPABASE_URL:-http://postgres:5432}
78+
SUPABASE_KEY: ${SUPABASE_KEY:-test-key}
79+
SUPABASE_DB_URL: ${SUPABASE_DB_URL:-postgresql://postgres:postgres@postgres:5432/postgres}
6180
REDIS_URL: redis://redis:6379/0
6281
CELERY_BROKER_URL: redis://redis:6379/0
6382
CELERY_RESULT_BACKEND: redis://redis:6379/1
@@ -66,6 +85,8 @@ services:
6685
- ./src:/app/src
6786
- ./tests:/app/tests
6887
depends_on:
88+
postgres:
89+
condition: service_healthy
6990
redis:
7091
condition: service_healthy
7192
api:

tests/test_integration.py

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)