test: add SLO incident verification

This commit is contained in:
2026-11-01 17:06:37 +03:00
parent 4bf383bd51
commit 441b752257
16 changed files with 1216 additions and 17 deletions
+9 -3
View File
@@ -16,11 +16,13 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 45
env:
COMPOSE_PROJECT_NAME: mtusi2026lab5-${{ github.run_id }}
COMPOSE_PROJECT_NAME: mtusi2026lab6-${{ github.run_id }}
API_BIND_ADDRESS: 127.0.0.1:0
SWAGGER_BIND_ADDRESS: 127.0.0.1:0
PROMETHEUS_BIND_ADDRESS: 127.0.0.1:0
GRAFANA_BIND_ADDRESS: 127.0.0.1:0
LOKI_BIND_ADDRESS: 127.0.0.1:0
TEMPO_BIND_ADDRESS: 127.0.0.1:0
steps:
- name: Checkout exact commit
run: |
@@ -46,7 +48,8 @@ jobs:
- name: Check formatting and shell scripts
run: |
test -z "$(gofmt -l cmd internal migrations)"
sh -n infra/minio/bootstrap.sh scripts/restart.sh scripts/rolling-update.sh scripts/stop-one.sh scripts/test-lab5.sh scripts/test-lab5-acceptance.sh
sh -n infra/minio/bootstrap.sh scripts/restart.sh scripts/rolling-update.sh scripts/stop-one.sh scripts/test-lab5.sh scripts/test-lab5-acceptance.sh scripts/test-lab6.sh scripts/incident-worker.sh scripts/incident-database.sh scripts/incident-telemetry.sh
python3 -m py_compile scripts/lab6-traffic.py scripts/lab6-observe.py scripts/lab6-alert.py scripts/lab6-correlation.py scripts/validate-lab6-evidence.py
- name: Lint
uses: golangci/golangci-lint-action@v7
@@ -62,11 +65,12 @@ jobs:
- name: Prepare local stack
run: |
cp lab5.env.example .env
cp lab6.env.example .env
docker compose config --quiet
docker compose up -d --build --scale api=2 --wait --wait-timeout 150
docker network connect "${COMPOSE_PROJECT_NAME}_application" "$HOSTNAME"
docker network connect "${COMPOSE_PROJECT_NAME}_data" "$HOSTNAME"
docker network connect "${COMPOSE_PROJECT_NAME}_monitoring" "$HOSTNAME"
- name: Integration checks
run: |
@@ -82,6 +86,7 @@ jobs:
docker compose up -d --scale api=2 --wait --wait-timeout 90
make test-lab5-acceptance
make test-lab5
ENV_FILE=.env PROMETHEUS_URL=http://prometheus:9090 TEMPO_URL=http://tempo:3200 LOKI_URL=http://loki:3100 make test-lab6-smoke BASE_URL=http://nginx:8080
- name: Container logs
if: failure()
@@ -92,4 +97,5 @@ jobs:
run: |
docker network disconnect "${COMPOSE_PROJECT_NAME}_application" "$HOSTNAME" 2>/dev/null || true
docker network disconnect "${COMPOSE_PROJECT_NAME}_data" "$HOSTNAME" 2>/dev/null || true
docker network disconnect "${COMPOSE_PROJECT_NAME}_monitoring" "$HOSTNAME" 2>/dev/null || true
if [ -f .env ]; then docker compose --profile tests down -v --remove-orphans; fi