Files
stemengine_old/Makefile
T

53 lines
1.9 KiB
Makefile

# StemEngine backend — development helpers
#
# All commands run tests inside the built Docker image so they use the same
# Python + dependency versions as production. Build the image first with
# `make build` before running any test targets.
IMAGE := stemengine:latest
BACKEND := backend
.PHONY: build test test-all test-smoke test-phase4 test-phase5 test-normalization alembic-upgrade alembic-heads help
help:
@echo ""
@echo " make build Build the Docker image"
@echo " make test Run the full backend test suite"
@echo " make test-smoke Smoke tests only (app boot + core routes)"
@echo " make test-phase4 Phase 4 operational-hardening tests"
@echo " make test-phase5 Phase 5 normalization tests"
@echo " make test-normalization Alias for test-phase5"
@echo " make alembic-upgrade Apply pending Alembic migrations inside container"
@echo " make alembic-heads Show current Alembic revision heads"
@echo ""
build:
docker build -t $(IMAGE) .
# Full test suite — discovers all test_*.py under /app/backend/tests
test:
docker run --rm $(IMAGE) bash -lc \
"python3.11 -m unittest discover -s /app/$(BACKEND)/tests -p 'test_*.py' -v"
# Subset targets for quick iteration
test-smoke:
docker run --rm $(IMAGE) bash -lc \
"python3.11 -m unittest $(BACKEND).tests.test_app_smoke -v"
test-phase4:
docker run --rm $(IMAGE) bash -lc \
"python3.11 -m unittest $(BACKEND).tests.test_operational_hardening -v"
test-phase5 test-normalization:
docker run --rm $(IMAGE) bash -lc \
"python3.11 -m unittest $(BACKEND).tests.test_phase5_normalization -v"
# Alembic helpers — run against the container's bundled DB path
alembic-upgrade:
docker run --rm $(IMAGE) bash -lc \
"cd /app && python3.11 -m alembic -c $(BACKEND)/alembic.ini upgrade head"
alembic-heads:
docker run --rm $(IMAGE) bash -lc \
"cd /app && python3.11 -m alembic -c $(BACKEND)/alembic.ini heads"