diff --git a/go.mod b/go.mod index 1a4d8d62..39546390 100644 --- a/go.mod +++ b/go.mod @@ -87,7 +87,7 @@ require ( github.com/LeanerCloud/cloud-commitments-go/pkg v0.0.0-20261008100513-a9a426224031 github.com/LeanerCloud/cloud-commitments-go/providers/aws v0.0.0-20261003204812-9962786e0695 github.com/LeanerCloud/cloud-commitments-go/providers/azure v0.0.0-20261007130138-e24345ce68f8 - github.com/LeanerCloud/cloud-commitments-go/providers/gcp v0.0.0-20260929223111-a32fd1a178e9 + github.com/LeanerCloud/cloud-commitments-go/providers/gcp v0.0.0-20261009093408-2c18f303abfc github.com/aws/aws-lambda-go v1.47.0 github.com/aws/aws-sdk-go-v2/service/kms v1.50.4 github.com/aws/aws-sdk-go-v2/service/lambda v1.89.0 diff --git a/go.sum b/go.sum index 93810e40..c8e552af 100644 --- a/go.sum +++ b/go.sum @@ -98,8 +98,8 @@ github.com/LeanerCloud/cloud-commitments-go/providers/aws v0.0.0-20261003204812- github.com/LeanerCloud/cloud-commitments-go/providers/aws v0.0.0-20261003204812-9962786e0695/go.mod h1:d4nsy61/Ptib0SxqMg0ble3yksVm3+QbtUtmGja82PA= github.com/LeanerCloud/cloud-commitments-go/providers/azure v0.0.0-20261007130138-e24345ce68f8 h1:4qx5bagtW25H5X+whaZ/3tWXP7VGyG/qcypTh8yK7Hc= github.com/LeanerCloud/cloud-commitments-go/providers/azure v0.0.0-20261007130138-e24345ce68f8/go.mod h1:iIvPuWLWd+SXqLHAQNdodYMUAAcq7PnwfScXWgARt5A= -github.com/LeanerCloud/cloud-commitments-go/providers/gcp v0.0.0-20260929223111-a32fd1a178e9 h1:8OuEGhDypUxV0zv+RisoPKW+i1OGst1DBcNj0gkeA98= -github.com/LeanerCloud/cloud-commitments-go/providers/gcp v0.0.0-20260929223111-a32fd1a178e9/go.mod h1:SRfSbPLG/s8xQsiQUEuo8KXVthI5NUUQXWahoccfutc= +github.com/LeanerCloud/cloud-commitments-go/providers/gcp v0.0.0-20261009093408-2c18f303abfc h1:hCLUvpI5U42BRh4M9EvjKaBg70P2ijbKxO9eNn7wMK0= +github.com/LeanerCloud/cloud-commitments-go/providers/gcp v0.0.0-20261009093408-2c18f303abfc/go.mod h1:D2ZwYqlDm/304JWfOw8YX/e+/YTc51Q9kiIaHJN7nxY= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/aws/aws-lambda-go v1.47.0 h1:0H8s0vumYx/YKs4sE7YM0ktwL2eWse+kfopsRI1sXVI= diff --git a/internal/purchase/gcp_history_cost_test.go b/internal/purchase/gcp_history_cost_test.go index 7f891cf4..89bd76ec 100644 --- a/internal/purchase/gcp_history_cost_test.go +++ b/internal/purchase/gcp_history_cost_test.go @@ -2,6 +2,7 @@ package purchase import ( "context" + "errors" "testing" "cloud.google.com/go/compute/apiv1/computepb" @@ -29,6 +30,12 @@ func (fakeCommitmentsService) Insert(context.Context, *computepb.InsertRegionCom return fakeCommitmentOp{}, nil } +// Get is only reached when an insert returns 409; this fake never does, so a +// call means the test no longer drives the path it was written for. +func (fakeCommitmentsService) Get(context.Context, *computepb.GetRegionCommitmentRequest) (*computepb.Commitment, error) { + return nil, errors.New("fakeCommitmentsService.Get is not expected in this test") +} + func (fakeCommitmentsService) Close() error { return nil } // TestSavePurchaseHistory_GCPRecordsNoUpfront drives the real library GCP client