Skip to content

Commit eebb2a8

Browse files
author
Johannes Lichtenberger
committed
Add service verification and better error logging to CI
- Add step to verify Keycloak and SirixDB are accessible before running tests - Add -s flag to pytest for better output visibility - Add step to show Docker logs on test failure for debugging - This will help identify if services aren't ready or if tests are actually failing
1 parent ea21fe2 commit eebb2a8

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,20 @@ jobs:
2424
architecture: x64
2525
- name: setup SirixDB server
2626
run: bash ./test.sh
27+
- name: verify services are running
28+
run: |
29+
docker ps
30+
echo "Checking Keycloak..."
31+
curl -f http://localhost:8080/realms/master || echo "Keycloak not ready"
32+
echo "Checking SirixDB..."
33+
curl -k -f https://localhost:9443 || echo "SirixDB not ready"
2734
- name: install dependencies
2835
run: |
2936
python -m pip install --upgrade pip
3037
pip install -r requirements-all.txt
3138
- name: test with pytest
32-
run: python -m pytest --cov=pysirix --cov-config=.coveragerc -v
39+
run: python -m pytest --cov=pysirix --cov-config=.coveragerc -v -s
40+
- name: show docker logs on failure
41+
if: failure()
42+
run: |
43+
docker compose -f ./tests/resources/docker-compose.yml logs

0 commit comments

Comments
 (0)