| .PHONY: wire build build-embed test-unit test-integration test-e2e test-cover-integration | |
| wire: | |
| "生成 Wire 代码..." | |
| cmd/server && go generate | |
| "Wire 代码生成完成" | |
| build: | |
| "构建后端(不嵌入前端)..." | |
| build -o bin/server ./cmd/server | |
| "构建完成: bin/server" | |
| build-embed: | |
| "构建后端(嵌入前端)..." | |
| build -tags embed -o bin/server ./cmd/server | |
| "构建完成: bin/server (with embedded frontend)" | |
| test-unit: | |
| test -tags unit ./... -count=1 | |
| test-integration: | |
| test -tags integration ./... -count=1 -race -parallel=8 | |
| test-e2e: | |
| "运行 E2E 测试(需要本地服务器运行)..." | |
| test -tags e2e ./internal/integration/... -count=1 -v | |
| test-cover-integration: | |
| "运行集成测试并生成覆盖率报告..." | |
| test -tags=integration -cover -coverprofile=coverage.out -count=1 -race -parallel=8 ./... | |
| tool cover -func=coverage.out | tail -1 | |
| tool cover -html=coverage.out -o coverage.html | |
| "覆盖率报告已生成: coverage.html" | |
| clean-coverage: | |
| -f coverage.out coverage.html | |
| "覆盖率文件已清理" | |
| clean: clean-coverage | |
| -rf bin/ | |
| "构建产物已清理" |