Skip to content

Commit 5d49f02

Browse files
Update test action to show logs
1 parent 5c709ee commit 5d49f02

3 files changed

Lines changed: 23 additions & 9 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ jobs:
2121
- name: Run tests
2222
run: make test
2323

24+
- name: Show container logs on failure
25+
if: failure()
26+
run: |
27+
echo "=== API Logs ==="
28+
docker compose logs api
29+
echo ""
30+
echo "=== Worker Logs ==="
31+
docker compose logs worker
32+
echo ""
33+
echo "=== Redis Logs ==="
34+
docker compose logs redis
35+
2436
deploy:
2537
name: Deploy
2638
runs-on: ubuntu-latest

.github/workflows/test.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ jobs:
1818
- name: Run tests
1919
run: make test
2020

21-
- name: Report test results
22-
if: always()
21+
- name: Show container logs on failure
22+
if: failure()
2323
run: |
24-
if [ $? -eq 0 ]; then
25-
echo "✅ All tests passed"
26-
else
27-
echo "❌ Tests failed"
28-
exit 1
29-
fi
24+
echo "=== API Logs ==="
25+
docker compose logs api
26+
echo ""
27+
echo "=== Worker Logs ==="
28+
docker compose logs worker
29+
echo ""
30+
echo "=== Redis Logs ==="
31+
docker compose logs redis

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
20+
docker compose --profile test up --build --exit-code-from test test || (docker compose logs api && docker compose logs worker && exit 1)
2121

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

0 commit comments

Comments
 (0)