ЛР2 — БВТ2302 — Никитина — на 5 (трек 2)
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
Yuliiiaaaa
2026-10-20 00:04:12 +03:00
parent 65003b6119
commit 7255878240
26 changed files with 1426 additions and 47 deletions
+27 -12
View File
@@ -1,13 +1,13 @@
PYTHON ?= python3
BASE_URL ?= http://localhost:8080
CA_FILE ?=
ACTION_SCRIPT ?=
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
PYTHON ?= python
BASE_URL ?= http://127.0.0.1:8080
CA_FILE ?=
IMAGE ?= mtusi-messenger:lab2
CONTAINER ?= mtusi-messenger-lab2
.PHONY: help check validate test load test-persistence
.PHONY: help check validate test build run stop student-tests experiment test-persistence
help:
@echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes"
@echo "targets: check validate test build run stop student-tests experiment test-persistence"
check:
$(PYTHON) scripts/check_contract.py
@@ -16,11 +16,26 @@ validate:
$(PYTHON) scripts/validate_openapi.py
test:
$(PYTHON) tests/smoke.py --base-url "$(BASE_URL)" $(TLS_ARGS)
$(PYTHON) tests/smoke.py --base-url $(BASE_URL)
load:
$(PYTHON) tests/load.py --base-url "$(BASE_URL)" $(TLS_ARGS)
# Для Лабораторной 2 мы используем Docker Compose
build:
docker compose build
run:
docker compose up -d
stop:
docker compose down
student-tests:
$(PYTHON) student-tests/test_negative.py --base-url $(BASE_URL)
$(PYTHON) student-tests/test_pagination.py --base-url $(BASE_URL)
$(PYTHON) student-tests/test_concurrency.py --base-url $(BASE_URL)
experiment:
$(PYTHON) student-tests/load_experiment.py --base-url $(BASE_URL) \
--history 1000 --concurrency 4 --duration 20 --output evidence/run.json
test-persistence:
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT to your implemented executable restart hook"; exit 2)
$(PYTHON) tests/resilience.py --mode persistence --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)
$(PYTHON) tests/test_persistence.py --base-url $(BASE_URL) --action-script $(ACTION_SCRIPT)