ЛР 2: PostgreSQL, сессии, Redis и исследование
Skeleton contracts / contracts (pull_request) Failing after 30s
Skeleton contracts / contracts (pull_request) Failing after 30s
This commit is contained in:
@@ -1,13 +1,41 @@
|
||||
PYTHON ?= python3
|
||||
BASE_URL ?= http://localhost:8080
|
||||
-include .env
|
||||
|
||||
API_PORT ?= 8080
|
||||
PYTHON ?= $(if $(wildcard .venv/bin/python),.venv/bin/python,python3)
|
||||
BASE_URL ?= http://localhost:$(API_PORT)
|
||||
CA_FILE ?=
|
||||
ACTION_SCRIPT ?=
|
||||
ACTION_SCRIPT ?= scripts/restart.sh
|
||||
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
|
||||
|
||||
.PHONY: help check validate test load test-persistence
|
||||
.PHONY: help build run up down restart check validate test student-test test-ui test-expiry test-grade4 test-dependencies explain-history verify-grade4 research-grade5 verify-grade5 load test-persistence
|
||||
|
||||
help:
|
||||
@echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes"
|
||||
@echo "build: compile C# API; run: start API with DATABASE_URL or DATABASE_URL_FILE"
|
||||
@echo "up: start API/PostgreSQL/Redis; down: stop without deleting data; restart: restart all three"
|
||||
@echo "check: offline skeleton structure; validate: full OpenAPI (requirements-dev.txt)"
|
||||
@echo "test: public Lab2 smoke; student-test: additional Lab2 checks"
|
||||
@echo "test-ui: optional web API authentication, privacy and backwards pagination"
|
||||
@echo "test-expiry: short session TTL; test-persistence: restart check"
|
||||
@echo "test-grade4: registration race, transaction rollback and Redis cache; test-dependencies: local outage checks"
|
||||
@echo "explain-history: seed 10000 synthetic messages and capture EXPLAIN ANALYZE BUFFERS"
|
||||
@echo "verify-grade4: run all checks on the running stack, save evidence/grade4-checks.txt"
|
||||
@echo "research-grade5: 100000 messages, index comparison and independent backup/restore; verify-grade5: grades 3/4 + research"
|
||||
|
||||
build:
|
||||
dotnet build src/Messenger.Api/Messenger.Api.csproj --nologo
|
||||
|
||||
run:
|
||||
dotnet run --no-launch-profile --project src/Messenger.Api/Messenger.Api.csproj
|
||||
|
||||
up:
|
||||
./scripts/init-secrets.sh
|
||||
docker compose up -d --build --wait --wait-timeout 90
|
||||
|
||||
down:
|
||||
docker compose down
|
||||
|
||||
restart:
|
||||
./scripts/restart.sh
|
||||
|
||||
check:
|
||||
$(PYTHON) scripts/check_contract.py
|
||||
@@ -18,6 +46,34 @@ validate:
|
||||
test:
|
||||
$(PYTHON) tests/smoke.py --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
|
||||
student-test:
|
||||
$(PYTHON) student-tests/lab2_tests.py --base-url "$(BASE_URL)"
|
||||
|
||||
test-ui:
|
||||
$(PYTHON) student-tests/ui_api_tests.py --base-url "$(BASE_URL)"
|
||||
|
||||
test-grade4:
|
||||
$(PYTHON) student-tests/grade4_tests.py --base-url "$(BASE_URL)"
|
||||
|
||||
test-dependencies:
|
||||
$(PYTHON) student-tests/dependency_tests.py --base-url "$(BASE_URL)"
|
||||
|
||||
explain-history:
|
||||
$(PYTHON) student-tests/explain_history.py --base-url "$(BASE_URL)"
|
||||
|
||||
verify-grade4:
|
||||
BASE_URL="$(BASE_URL)" PYTHON="$(PYTHON)" ./scripts/verify-grade4.sh
|
||||
@echo "PASS: grade 4 checks; results in evidence/grade4-checks.txt"
|
||||
|
||||
research-grade5:
|
||||
$(PYTHON) -u student-tests/research_track2.py --base-url "$(BASE_URL)"
|
||||
|
||||
verify-grade5:
|
||||
BASE_URL="$(BASE_URL)" PYTHON="$(PYTHON)" ./scripts/verify-grade5.sh
|
||||
|
||||
test-expiry:
|
||||
BASE_URL="$(BASE_URL)" PYTHON="$(PYTHON)" ./scripts/test-expiry.sh
|
||||
|
||||
load:
|
||||
$(PYTHON) tests/load.py --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user