auth tests
This commit is contained in:
21
Makefile
21
Makefile
@@ -12,7 +12,7 @@ DC := docker compose
|
||||
EXEC := $(DC) exec -u $(UID):$(GID) backend
|
||||
|
||||
.DEFAULT_GOAL := help
|
||||
.PHONY: help up down build logs composer be-install be-update artisan migrate import tinker fe-install fe-add fe-rebuild fe-dev fe-build permissions
|
||||
.PHONY: help up down build logs composer be-install be-update artisan migrate import tinker test fe-install fe-add fe-rebuild fe-dev fe-build fe-lint-css fe-lint-css-fix permissions
|
||||
|
||||
help: ## Mostra questo aiuto
|
||||
@grep -hE '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | awk 'BEGIN{FS=":.*?## "}{printf " \033[36m%-14s\033[0m %s\n",$$1,$$2}'
|
||||
@@ -42,6 +42,20 @@ import: ## ETL da v1 (container)
|
||||
$(EXEC) php artisan v1:import
|
||||
tinker: ## REPL artisan (container)
|
||||
$(EXEC) php artisan tinker
|
||||
test: ## Suite di test sul DB dedicato db-test (es: make test c="--filter=AuthTest")
|
||||
# Le -e iniettano VERE env nel processo di test → finiscono in $$_SERVER, che
|
||||
# l'env() di Laravel legge per primo. Così vincono sul container (DB_HOST=db,
|
||||
# DB_DATABASE=dyncoll) SENZA dipendere dai force di phpunit.xml. DB_HOST=db-test
|
||||
# = isolamento fisico: la suite non può nemmeno raggiungere il db di sviluppo.
|
||||
$(DC) exec -u $(UID):$(GID) \
|
||||
-e APP_ENV=testing \
|
||||
-e DB_HOST=db-test \
|
||||
-e DB_DATABASE=dyncoll_test \
|
||||
-e CACHE_STORE=array \
|
||||
-e SESSION_DRIVER=array \
|
||||
-e QUEUE_CONNECTION=sync \
|
||||
-e MAIL_MAILER=array \
|
||||
backend php artisan test $(c)
|
||||
|
||||
## --- Frontend / Node ---
|
||||
# In dev Vite gira NEL container (make up): HMR via bind-mount, node_modules musl
|
||||
@@ -58,7 +72,10 @@ fe-dev: ## ALTERNATIVA: vite dev server su host senza Docker (conflitto porta 51
|
||||
cd frontend && npm run dev
|
||||
fe-build: ## build di produzione su host (smoke test locale)
|
||||
cd frontend && npm run build
|
||||
|
||||
fe-lint-css: ## Stylelint (check) nel container — gira anche nel pre-commit
|
||||
$(DC) exec -T frontend npm run lint:css
|
||||
fe-lint-css-fix: ## Stylelint con --fix (container come UID host: scrive sul bind-mount)
|
||||
$(DC) exec -u $(UID):$(GID) -T frontend npm run lint:css:fix
|
||||
## --- Manutenzione ---
|
||||
permissions: ## Permessi storage scrivibili da php-fpm (www-data) — richiede sudo, una tantum
|
||||
sudo chgrp -R www-data backend/storage backend/bootstrap/cache
|
||||
|
||||
Reference in New Issue
Block a user