From 92d770f6f718abc5c4fad3d8817acf2d01aecd40 Mon Sep 17 00:00:00 2001 From: awei Date: Thu, 30 Jul 2026 02:20:28 +0800 Subject: [PATCH] =?UTF-8?q?ci(dispatch):=20=E6=8A=8A=E9=80=99=E6=89=B9?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=9A=84=E7=B4=94=E5=96=AE=E5=85=83=E6=B8=AC?= =?UTF-8?q?=E8=A9=A6=E8=A3=9C=E9=80=B2=20-run=20=E7=99=BD=E5=90=8D?= =?UTF-8?q?=E5=96=AE=EF=BC=88=E5=90=A6=E5=89=87=20CI=20=E6=A0=B9=E6=9C=AC?= =?UTF-8?q?=E6=B2=92=E8=B7=91=E5=88=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI 不啟 Docker,service 套件只跑手動維護的 -run 白名單。這批(U/U2/U3)新增的 TestCustomerPushCopy_/TestCustomerRidePushData_/TestNotifyCustomerRide_/ TestPreviewText/TestLostItemPushTitle 都沒在名單上——本機有 Docker 才跑得到, CI 綠燈其實不代表它們跑過。順手補上一直漏掉的 TestRideOfferPushData。 同時在註解寫明這是手動白名單、新增測試要記得補,免得下次又漏。 驗證:以新名單在 CGO_ENABLED=0、無 Docker 條件下跑,28 個測試通過、0.7 秒完成 (真的沒碰 DB)。 Co-Authored-By: Claude Opus 5 --- .github/workflows/go-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go-ci.yml b/.github/workflows/go-ci.yml index d1d981f..4dfcbbe 100644 --- a/.github/workflows/go-ci.yml +++ b/.github/workflows/go-ci.yml @@ -37,6 +37,9 @@ jobs: - name: Unit tests (no Docker) # repository/redis/service 內含 testcontainers 整合測;CI 不啟 Docker, # 只跑純單元包+service 中明確不碰 DB 的測試名。 + # + # ⚠️ 這串 -run 是**手動維護的白名單**:service 裡新增的純單元測試如果沒加進來, + # CI 綠燈**不代表它跑過**(本機有 Docker 才會跑到)。新增測試時記得補這一行。 run: | CGO_ENABLED=0 go test -count=1 -timeout 60s \ ./cmd/server/ \ @@ -50,4 +53,4 @@ jobs: ./internal/notify/ \ ./internal/util/ CGO_ENABLED=0 go test -count=1 -timeout 60s ./internal/service/ \ - -run 'TestRideAuditor_|TestStatusPtrHelpers|TestEventTypeConstants_|TestDeviceTokenService_|TestValidatePickup|TestValidateOptional|TestRideAssignedPayload_|TestRideAcceptedDriverPayload_|TestFormatETA|TestDispatcher_|TestBillableDistanceM|TestQuote' + -run 'TestRideAuditor_|TestStatusPtrHelpers|TestEventTypeConstants_|TestDeviceTokenService_|TestValidatePickup|TestValidateOptional|TestRideAssignedPayload_|TestRideAcceptedDriverPayload_|TestFormatETA|TestDispatcher_|TestBillableDistanceM|TestQuote|TestCustomerPushCopy_|TestCustomerRidePushData_|TestNotifyCustomerRide_|TestPreviewText|TestLostItemPushTitle|TestRideOfferPushData'