Skip to content

Commit eb02dc6

Browse files
Release version 0.1.12
### Added - Changes in dev.sh - Changes in infra/ansible/playbook.yml - Changes in install.sh - Changes in pyproject.toml - Changes in setup.py - Changes in stop.sh - Changes in tests.sh ### Removed - Changes in containers/test-runner/tests/test-browser-service.py - Changes in containers/test-runner/tests/test-complex-form.py - Changes in containers/test-runner/tests/test-file-upload.py - Changes in containers/test-runner/tests/test-healthcheck.py - Changes in containers/test-runner/tests/test-ports.py - Changes in containers/test-runner/tests/test-simple-form.py
1 parent 4f58c17 commit eb02dc6

22 files changed

Lines changed: 271 additions & 54 deletions

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.1.12] - 2025-05-13
6+
7+
### Added
8+
- Changes in dev.sh
9+
- Changes in infra/ansible/playbook.yml
10+
- Changes in install.sh
11+
- Changes in pyproject.toml
12+
- Changes in setup.py
13+
- Changes in stop.sh
14+
- Changes in tests.sh
15+
16+
### Removed
17+
- Changes in containers/test-runner/tests/test-browser-service.py
18+
- Changes in containers/test-runner/tests/test-complex-form.py
19+
- Changes in containers/test-runner/tests/test-file-upload.py
20+
- Changes in containers/test-runner/tests/test-healthcheck.py
21+
- Changes in containers/test-runner/tests/test-ports.py
22+
- Changes in containers/test-runner/tests/test-simple-form.py
23+
524
## [0.1.11] - 2025-05-13
625

726
### Added

containers/test-runner/tests/test-healthcheck.py

Lines changed: 0 additions & 19 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import requests
2+
import pytest
3+
4+
import os
5+
6+
LOCAL_TEST = os.environ.get("LOCAL_TEST", "0") == "1"
7+
8+
if LOCAL_TEST:
9+
SERVICES = [
10+
("llm-orchestrator", "http://localhost:5000/health"),
11+
("browser-service", "http://localhost:3000/health"),
12+
("web-interface", "http://localhost:8080/"),
13+
("novnc", "http://localhost:6080/"),
14+
("video-chat", "http://localhost:8443/"), # uwaga: port 443 może być mapowany na inny lokalny port
15+
("web-terminal", "http://localhost:8081/"),
16+
]
17+
else:
18+
SERVICES = [
19+
("llm-orchestrator", "http://llm-orchestrator:5000/health"),
20+
("browser-service", "http://browser-service:3000/health"),
21+
("web-interface", "http://web-interface:8080/"),
22+
("novnc", "http://novnc:6080/"),
23+
("video-chat", "http://video-chat:443/"),
24+
("web-terminal", "http://web-terminal:8081/"),
25+
]
26+
27+
@pytest.mark.parametrize("service_name, url", SERVICES)
28+
def test_service_health(service_name, url):
29+
try:
30+
resp = requests.get(url, timeout=10, verify=False)
31+
assert resp.status_code in (200, 401, 403)
32+
except Exception as e:
33+
pytest.fail(f"{service_name} not healthy: {e}")
File renamed without changes.
File renamed without changes.

containers/test-service.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
# test-service.sh <service-name>
3+
# Skrypt do testowania pojedynczego serwisu Docker
4+
set -e
5+
6+
SERVICE="$1"
7+
if [ -z "$SERVICE" ]; then
8+
echo "Użycie: $0 <service-name>"
9+
exit 1
10+
fi
11+
12+
COMPOSE_FILE="docker-compose.$SERVICE.yml"
13+
14+
if [ ! -f "$COMPOSE_FILE" ]; then
15+
echo "Brak pliku $COMPOSE_FILE! Utwórz docker-compose.<service>.yml dla każdego serwisu."
16+
exit 2
17+
fi
18+
19+
echo "[INFO] Buduję i uruchamiam środowisko dla: $SERVICE..."
20+
docker-compose -f "$COMPOSE_FILE" up --build -d
21+
22+
# Czekaj na start kontenera (możesz rozwinąć o healthcheck)
23+
sleep 5
24+
25+
echo "[INFO] Testuję serwis: $SERVICE..."
26+
# Przykładowy test: sprawdź czy kontener działa
27+
if docker-compose -f "$COMPOSE_FILE" ps | grep -q 'Up'; then
28+
echo "[OK] Kontener $SERVICE działa."
29+
else
30+
echo "[FAIL] Kontener $SERVICE nie działa!"
31+
docker-compose -f "$COMPOSE_FILE" logs
32+
docker-compose -f "$COMPOSE_FILE" down
33+
exit 3
34+
fi
35+
36+
# (Opcjonalnie) Dodaj własne testy HTTP/API dla danego serwisu tutaj
37+
# Przykład dla llm-orchestrator:
38+
if [ "$SERVICE" = "llm-orchestrator" ]; then
39+
curl -f http://localhost:5000/health && echo "[OK] Healthcheck passed." || echo "[FAIL] Healthcheck failed!"
40+
fi
41+
42+
# Wyświetl logi
43+
echo "[INFO] Logi serwisu $SERVICE:"
44+
docker-compose -f "$COMPOSE_FILE" logs
45+
46+
# Zatrzymaj środowisko
47+
echo "[INFO] Zatrzymuję środowisko $SERVICE..."
48+
docker-compose -f "$COMPOSE_FILE" down

dev.sh

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
11
#!/bin/bash
2-
# dev.sh - Uruchamianie minimalnego stacka i testowanie llm-orchestrator
2+
# dev.sh - Testuje każdy serwis dockerowy osobno i uruchamia testy Ansible healthcheck
33
set -e
44

5-
COMPOSE_FILE="docker-compose.minimal.yml"
6-
TEST_DIR="test-examples"
5+
SERVICES=(llm-orchestrator browser-service web-interface novnc video-chat web-terminal)
76

8-
# 1. Buduj i uruchom minimalny stack w tle
9-
echo "[INFO] Buduję i uruchamiam stack ($COMPOSE_FILE)..."
10-
docker-compose -f "$COMPOSE_FILE" up --build -d
7+
for SERVICE in "${SERVICES[@]}"; do
8+
echo -e "\n==============================="
9+
echo "[DEV] TESTUJĘ SERWIS: $SERVICE"
10+
echo "==============================="
11+
bash containers/test-service.sh "$SERVICE"
1112

12-
# 2. Poczekaj aż llm-orchestrator będzie dostępny (port 5000)
13-
echo "[INFO] Czekam na uruchomienie llm-orchestrator na porcie 5000..."
14-
for i in {1..30}; do
15-
if curl -s http://localhost:5000/ > /dev/null; then
16-
echo "[INFO] llm-orchestrator jest dostępny."
17-
break
13+
# Po każdym teście uruchom healthcheck Ansible tylko dla tego serwisu
14+
if [ -f "infra/ansible/playbook.yml" ]; then
15+
case $SERVICE in
16+
llm-orchestrator)
17+
ENDPOINT="[{name:'llm-orchestrator',url:'http://localhost:5000/health',status:200}]";;
18+
browser-service)
19+
ENDPOINT="[{name:'browser-service',url:'http://localhost:3000/health',status:200}]";;
20+
web-interface)
21+
ENDPOINT="[{name:'web-interface',url:'http://localhost:8080/',status:200}]";;
22+
novnc)
23+
ENDPOINT="[{name:'novnc',url:'http://localhost:6080/',status:200}]";;
24+
video-chat)
25+
ENDPOINT="[{name:'video-chat',url:'http://localhost:8443/',status:200}]";;
26+
web-terminal)
27+
ENDPOINT="[{name:'web-terminal',url:'http://localhost:8081/',status:200}]";;
28+
*)
29+
ENDPOINT="[]";;
30+
esac
31+
echo "[DEV] Ansible E2E healthcheck dla $SERVICE..."
32+
ansible-playbook infra/ansible/playbook.yml --extra-vars "endpoints=$ENDPOINT" || echo "[WARN] Ansible E2E healthcheck failed for $SERVICE!"
33+
else
34+
echo "[WARN] Brak infra/ansible/playbook.yml - pomijam testy Ansible."
1835
fi
19-
sleep 2
36+
echo "[DEV] ZAKOŃCZONO TESTY SERWISU: $SERVICE"
37+
echo "===============================\n"
2038
done
2139

22-
# 3. Uruchom testy przykładowe (jeśli katalog i skrypt istnieją)
23-
if [ -d "$TEST_DIR" ] && [ -f "$TEST_DIR/run_examples.py" ]; then
24-
echo "[INFO] Uruchamiam testy przykładowe..."
25-
docker-compose -f "$COMPOSE_FILE" run --rm test-client
26-
else
27-
echo "[WARN] Brak katalogu $TEST_DIR lub pliku run_examples.py - pomijam testy."
28-
fi
29-
30-
# 4. Wyświetl logi llm-orchestrator po testach
31-
echo "[INFO] Logi llm-orchestrator po testach:"
32-
docker-compose -f "$COMPOSE_FILE" logs llm-orchestrator
33-
34-
# 5. Zatrzymaj stack po zakończeniu
35-
echo "[INFO] Zatrzymuję stack..."
36-
docker-compose -f "$COMPOSE_FILE" down
40+
echo "[DEV] Wszystkie testy serwisów zakończone."

0 commit comments

Comments
 (0)