From b6b739431c890734ae2a81fddbb4e3e750fafaf5 Mon Sep 17 00:00:00 2001 From: song Date: Sun, 28 Dec 2025 21:59:40 +0800 Subject: [PATCH] =?UTF-8?q?build:=20e2e=20=E6=B5=8B=E8=AF=95=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20build=20tag=20=E9=81=BF=E5=85=8D=20CI=20=E8=BF=90?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 //go:build e2e tag,CI 不会自动运行这些测试 - Makefile 添加 test-e2e 目标用于本地手动运行 --- backend/Makefile | 6 +++++- backend/internal/integration/e2e_gateway_test.go | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/Makefile b/backend/Makefile index 96b0129e..069884ed 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -1,4 +1,4 @@ -.PHONY: wire build build-embed test-unit test-integration test-cover-integration clean-coverage +.PHONY: wire build build-embed test-unit test-integration test-e2e test-cover-integration clean-coverage wire: @echo "生成 Wire 代码..." @@ -21,6 +21,10 @@ test-unit: test-integration: @go test -tags integration ./... -count=1 -race -parallel=8 +test-e2e: + @echo "运行 E2E 测试(需要本地服务器运行)..." + @go test -tags e2e ./internal/integration/... -count=1 -v + test-cover-integration: @echo "运行集成测试并生成覆盖率报告..." @go test -tags=integration -cover -coverprofile=coverage.out -count=1 -race -parallel=8 ./... diff --git a/backend/internal/integration/e2e_gateway_test.go b/backend/internal/integration/e2e_gateway_test.go index c7c58661..81f5974a 100644 --- a/backend/internal/integration/e2e_gateway_test.go +++ b/backend/internal/integration/e2e_gateway_test.go @@ -1,3 +1,5 @@ +//go:build e2e + package integration import (