Makefile Integration: - Add make verify-quick target for critical-only checks - Fix verify-guidelines target to call comprehensive script - Clear separation of usage patterns AI Behavior Protocol: - Add comprehensive AI instructions to both scripts - Enhanced error/warning functions with AI reminders - Multi-layered safeguards prevent automatic fixing - Protocol applies to ALL file modifications verify-quick.sh Enhancements: - Basic documentation structure validation - API content placement detection in README.md - Maintains fast performance for development Documentation: - Comprehensive scripts/README.md with usage guidelines - Bruno API tests validation explained - Troubleshooting and compliance sections - Clear AI protocol instructions and examples This provides dual-script approach: fast critical checks during development, comprehensive validation for pre-commit/CI, with AI safety across all operations.
69 lines
2.1 KiB
Makefile
69 lines
2.1 KiB
Makefile
.PHONY: help test test-integration test-all build build-force clean rebuild logs test-env-up test-env-down
|
|
|
|
# Default target
|
|
help:
|
|
@echo "Available targets:"
|
|
@echo " make test - Run unit tests"
|
|
@echo " make test-integration - Run integration tests with test mode enabled"
|
|
@echo " make test-all - Run all tests"
|
|
@echo " make build - Build and start containers"
|
|
@echo " make build-force - Force rebuild and start containers"
|
|
@echo " make clean - Stop and remove containers"
|
|
@echo " make rebuild - Clean, rebuild, and start containers"
|
|
@echo " make logs - Show container logs"
|
|
@echo " make test-env-up - Start containers with test mode enabled"
|
|
@echo " make test-env-down - Stop test environment"
|
|
|
|
# Run unit tests
|
|
test:
|
|
go test ./... -v -short
|
|
|
|
# Run integration tests with test mode enabled (avoids rate limiting)
|
|
test-integration:
|
|
@echo "Running integration tests with TEST_MODE enabled..."
|
|
TEST_MODE=true RATE_LIMIT_ENABLED=false go test ./cmd/server/tests -run TestIntegrationAPI -v -timeout 5m
|
|
|
|
# Run all tests
|
|
test-all: test test-integration
|
|
|
|
# Build and start containers
|
|
build:
|
|
podman compose up --build -d
|
|
|
|
# Force rebuild without cache
|
|
build-force:
|
|
podman compose build --no-cache
|
|
podman compose up -d
|
|
|
|
# Stop and remove containers
|
|
clean:
|
|
podman compose down -v
|
|
|
|
# Clean rebuild (remove volumes, rebuild, start)
|
|
rebuild: clean build
|
|
|
|
# Show container logs
|
|
logs:
|
|
podman compose logs -f
|
|
|
|
# Start containers with test mode enabled for integration testing
|
|
test-env-up:
|
|
@echo "Starting containers with test mode enabled..."
|
|
TEST_MODE=true RATE_LIMIT_ENABLED=false REQUESTS_PER_MINUTE=1000 podman compose up --build -d
|
|
@echo "Waiting for services to be ready..."
|
|
sleep 10
|
|
@echo "Test environment is ready!"
|
|
|
|
# Stop test environment
|
|
test-env-down:
|
|
podman compose down -v
|
|
|
|
# Verify project guidelines compliance
|
|
verify-guidelines:
|
|
@echo "Running comprehensive project guidelines verification..."
|
|
@./scripts/verify-guidelines.sh
|
|
|
|
verify-quick:
|
|
@echo "Running quick project guidelines verification..."
|
|
@./scripts/verify-quick.sh
|