From 184cacac82cac3bec4d7b772b0d1ac5c331d66d4 Mon Sep 17 00:00:00 2001 From: Astrid Gealer Date: Mon, 26 Oct 2026 09:48:25 +0000 Subject: [PATCH 1/2] test(server): embed mocks.MockConfigStore in mockConfigStoreForHealth First half of folding the hand-rolled health-test store onto the shared mock (#76). The type now embeds mocks.MockConfigStore and drops 68 of its ~150 hand-written stubs, which the embedded defaults now serve. CleanupOldExecutions and GetStaleProcessingExchanges stay: the shared mock requires an expectation for them, and the scheduled-task tests here call them without one. The type still defines more than half of StoreInterface, so it stays on the guard's allowlist until the next commit removes the rest. Co-Authored-By: Claude Opus 5.5 --- internal/server/test_helpers_test.go | 267 +-------------------------- 1 file changed, 5 insertions(+), 262 deletions(-) diff --git a/internal/server/test_helpers_test.go b/internal/server/test_helpers_test.go index e5a2cd73b..521d4f5f5 100644 --- a/internal/server/test_helpers_test.go +++ b/internal/server/test_helpers_test.go @@ -2,10 +2,8 @@ package server import ( "context" - "errors" "time" - "github.com/LeanerCloud/cloud-commitments-go/pkg/common" "github.com/LeanerCloud/cloud-commitments-go/pkg/ladder" "github.com/LeanerCloud/cloud-commitments-platform/internal/config" "github.com/LeanerCloud/cloud-commitments-platform/internal/database" @@ -16,276 +14,21 @@ import ( // databaseConfigStub is a type alias used in health tests to simulate pending DB config. type databaseConfigStub = database.Config -// mockConfigStoreForHealth implements config.StoreInterface for health check tests. -type mockConfigStoreForHealth struct{} - -func (m *mockConfigStoreForHealth) GetGlobalConfig(ctx context.Context) (*config.GlobalConfig, error) { - return &config.GlobalConfig{}, nil -} - -func (m *mockConfigStoreForHealth) SaveGlobalConfig(ctx context.Context, cfg *config.GlobalConfig) error { - return nil -} - -func (m *mockConfigStoreForHealth) GetServiceConfig(ctx context.Context, provider, service string) (*config.ServiceConfig, error) { - return &config.ServiceConfig{}, nil -} - -func (m *mockConfigStoreForHealth) SaveServiceConfig(ctx context.Context, cfg *config.ServiceConfig) error { - return nil -} - -func (m *mockConfigStoreForHealth) ListServiceConfigs(ctx context.Context) ([]config.ServiceConfig, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) CreatePurchasePlan(ctx context.Context, plan *config.PurchasePlan) error { - return nil -} - -func (m *mockConfigStoreForHealth) GetPurchasePlan(ctx context.Context, planID string) (*config.PurchasePlan, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) UpdatePurchasePlan(ctx context.Context, plan *config.PurchasePlan) error { - return nil -} - -func (m *mockConfigStoreForHealth) StampPlanNotificationSent(context.Context, string, time.Time) error { - return nil -} - -func (m *mockConfigStoreForHealth) CompletePlanStep(_ context.Context, _ string, _ int) error { - return nil -} - -func (m *mockConfigStoreForHealth) GetStuckRampSteps(_ context.Context) (map[string]config.RampStepBlock, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) LockPlanProvidersTx(_ context.Context, _ pgx.Tx, _ []string) error { - return nil -} - -func (m *mockConfigStoreForHealth) LockPurchasePlanTx(_ context.Context, _ pgx.Tx, _ string) (*config.PurchasePlan, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) OccupiedRampStepsInRangeTx(_ context.Context, _ pgx.Tx, _ string, _, _ int) ([]int, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) UpdatePurchasePlanTx(_ context.Context, _ pgx.Tx, _ *config.PurchasePlan) error { - return nil -} - -func (m *mockConfigStoreForHealth) DeletePurchasePlan(ctx context.Context, planID string) error { - return nil -} - -func (m *mockConfigStoreForHealth) ListPurchasePlans(ctx context.Context, filter config.PurchasePlanFilter) ([]config.PurchasePlan, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) SavePurchaseExecution(ctx context.Context, execution *config.PurchaseExecution) error { - return nil -} - -func (m *mockConfigStoreForHealth) GetPendingExecutions(ctx context.Context) ([]config.PurchaseExecution, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) GetExecutionsByStatuses(ctx context.Context, statuses []string, limit int) ([]config.PurchaseExecution, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) HistorySummaryAggregate(ctx context.Context, filter config.HistorySummaryFilter) (*config.HistorySummaryGroups, error) { - return &config.HistorySummaryGroups{}, nil -} - -func (m *mockConfigStoreForHealth) CountExecutionsByPlanAndStatus(ctx context.Context, statuses []string, since time.Time) (map[string]config.ExecutionStatusCounts, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) GetPlannedExecutions(ctx context.Context, statuses []string, limit int) ([]config.PurchaseExecution, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) ListHistoryExecutionsPage(ctx context.Context, q config.HistoryExecutionsPageQuery) ([]config.PurchaseExecution, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) ListPurchaseHistoryPage(ctx context.Context, filter config.PurchaseHistoryFilter, after *config.HistoryPageKey) ([]config.PurchaseHistoryPageRow, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) GetStaleApprovedExecutions(ctx context.Context, olderThan time.Duration) ([]config.PurchaseExecution, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) GetExecutionByID(ctx context.Context, executionID string) (*config.PurchaseExecution, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) GetExecutionByPlanAndDate(ctx context.Context, planID string, scheduledDate time.Time) (*config.PurchaseExecution, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) GetUserEmailByID(ctx context.Context, userID string) (string, error) { - return "", nil -} - -func (m *mockConfigStoreForHealth) SavePurchaseHistory(ctx context.Context, record *config.PurchaseHistoryRecord) error { - return nil -} - -func (m *mockConfigStoreForHealth) GetPurchaseHistory(ctx context.Context, accountID string, limit int) ([]config.PurchaseHistoryRecord, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) GetAllPurchaseHistory(ctx context.Context, limit int) ([]config.PurchaseHistoryRecord, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) GetActivePurchaseHistory(ctx context.Context, asOf time.Time, accountIDs []string, externalIDsByProvider map[string][]string) ([]config.PurchaseHistoryRecord, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) GetPurchaseHistoryFiltered(ctx context.Context, filter config.PurchaseHistoryFilter) ([]config.PurchaseHistoryRecord, error) { - return nil, nil +// mockConfigStoreForHealth implements config.StoreInterface for health check +// tests. It embeds mocks.MockConfigStore; the hand-written stubs below are +// being removed in favour of the embedded defaults (issue #76). +type mockConfigStoreForHealth struct { + mocks.MockConfigStore } func (m *mockConfigStoreForHealth) CleanupOldExecutions(ctx context.Context, retentionDays int) (int64, error) { return 0, nil } -func (m *mockConfigStoreForHealth) CountPendingExecutionsForAccount(ctx context.Context, accountID string) (int, error) { - return 0, nil -} - -func (m *mockConfigStoreForHealth) CountLiveExecutionsForAccount(ctx context.Context, accountID string) (int, error) { - return 0, nil -} - -func (m *mockConfigStoreForHealth) ListPendingExecutionIDsForAccount(ctx context.Context, accountID string) ([]string, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) TransitionExecutionStatus(ctx context.Context, executionID string, fromStatuses []string, toStatus string, actor *string) (*config.PurchaseExecution, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) TransitionExecutionStatusPinned(ctx context.Context, executionID string, fromStatuses []string, toStatus string, actor *string, sawEmptyRecommendations bool) (*config.PurchaseExecution, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) TransitionExecutionStatusPinnedTx(ctx context.Context, tx pgx.Tx, executionID string, fromStatuses []string, toStatus string, actor *string, sawEmptyRecommendations bool) (*config.PurchaseExecution, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) TransitionExecutionStatusTokenPinned(ctx context.Context, executionID string, fromStatuses []string, toStatus string, actor *string, rawToken string) (*config.PurchaseExecution, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) RescheduleAwaitingExecution(_ context.Context, _ string, _ time.Time) (bool, error) { - return false, nil -} - -func (m *mockConfigStoreForHealth) SetCancelledBy(_ context.Context, _ string, _ string) error { - return nil -} - -func (m *mockConfigStoreForHealth) RotatePendingApprovalToken(ctx context.Context, executionID, tokenHash string, expiresAt time.Time) (bool, error) { - return false, nil -} - -func (m *mockConfigStoreForHealth) LinkRetryExecutionAtomic(ctx context.Context, tx pgx.Tx, executionID, retryExecutionID string) (bool, error) { - return false, nil -} - -func (m *mockConfigStoreForHealth) LockLadderTrancheForRetryTx(ctx context.Context, tx pgx.Tx, idempotencyKey string) (ladder.TrancheStatus, bool, error) { - return "", false, nil -} - -func (m *mockConfigStoreForHealth) GetLadderExecutionGate(ctx context.Context, idempotencyKey string) (*config.LadderExecutionGate, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) CancelExecutionAtomic(ctx context.Context, tx pgx.Tx, executionID string, cancelledBy *string) (bool, string, error) { - return false, "", nil -} - -func (m *mockConfigStoreForHealth) CancelExecutionAtomicTokenPinned(ctx context.Context, tx pgx.Tx, executionID string, cancelledBy *string, rawToken string) (bool, string, error) { - return false, "", nil -} - -func (m *mockConfigStoreForHealth) CancelScheduledExecutionAtomic(ctx context.Context, tx pgx.Tx, executionID string, cancelledBy *string) (bool, string, error) { - return false, "", nil -} - -func (m *mockConfigStoreForHealth) ListStuckExecutions(ctx context.Context, statuses []string, olderThan time.Duration) ([]config.PurchaseExecution, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) SaveRIExchangeRecord(ctx context.Context, record *config.RIExchangeRecord) error { - return nil -} -func (m *mockConfigStoreForHealth) ReserveRIExchange(ctx context.Context, record *config.RIExchangeRecord, dailyCapUSD, perExchangeCapUSD string) (string, error) { - return "", errors.New("RI exchange reservation not configured in test store") -} - -func (m *mockConfigStoreForHealth) ReserveApprovedRIExchange(ctx context.Context, id, dailyCapUSD, perExchangeCapUSD string) (string, error) { - return "", errors.New("approved RI exchange reservation not configured in test store") -} -func (m *mockConfigStoreForHealth) GetRIExchangeRecord(ctx context.Context, id string) (*config.RIExchangeRecord, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) GetRIExchangeRecordByToken(ctx context.Context, token string) (*config.RIExchangeRecord, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) GetRIExchangeHistory(ctx context.Context, since time.Time, limit int) ([]config.RIExchangeRecord, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) GetRIExchangeHistoryForAccounts(ctx context.Context, since time.Time, limit int, accountIDs []string) ([]config.RIExchangeRecord, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) TransitionRIExchangeStatus(ctx context.Context, id string, fromStatus string, toStatus string, actor *string) (*config.RIExchangeRecord, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) CompleteRIExchange(ctx context.Context, id string, exchangeID string) error { - return nil -} -func (m *mockConfigStoreForHealth) CompleteRIExchangeWithPayment(_ context.Context, _, _, _ string) error { - return nil -} -func (m *mockConfigStoreForHealth) FailRIExchange(ctx context.Context, id string, errorMsg string) error { - return nil -} -func (m *mockConfigStoreForHealth) StampRIExchangeApprovedBy(_ context.Context, _ string, _ string) error { - return nil -} -func (m *mockConfigStoreForHealth) GetRIExchangeDailySpend(ctx context.Context, date time.Time) (string, error) { - return "0", nil -} -func (m *mockConfigStoreForHealth) CancelAllPendingExchanges(ctx context.Context) (int64, error) { - return 0, nil -} - -func (m *mockConfigStoreForHealth) CancelPendingExchangesByOrigin(_ context.Context, _ common.ExchangeOrigin) (int64, error) { - return 0, nil -} func (m *mockConfigStoreForHealth) GetStaleProcessingExchanges(ctx context.Context, olderThan time.Duration) ([]config.RIExchangeRecord, error) { return nil, nil } -func (m *mockConfigStoreForHealth) SaveRIExchangeDirectExecution(_ context.Context, _ *config.RIExchangeDirectExecution) error { - return nil -} - -func (m *mockConfigStoreForHealth) FinalizeRIExchangeDirectExecution(_ context.Context, _ string, _ config.RIExchangeDirectOutcome) error { - return nil -} - func (m *mockConfigStoreForHealth) CreateCloudAccount(ctx context.Context, account *config.CloudAccount) error { return nil } From 88958969b896befcd1c78bdc9b34933a3c734c92 Mon Sep 17 00:00:00 2001 From: Astrid Gealer Date: Mon, 26 Oct 2026 09:49:11 +0000 Subject: [PATCH 2/2] test(server): drop the last hand-written stubs from mockConfigStoreForHealth Finishes folding the health-test store onto mocks.MockConfigStore (#76). The 80 remaining hand-written stubs are gone. Only the two overrides the server tests need are left, so a new StoreInterface method no longer needs a stub here. The type no longer hand-rolls the interface, so it comes off the guard's allowlist, which is now empty: any new hand-rolled copy fails TestNoHandRolledConfigStoreMocks. Co-Authored-By: Claude Opus 5.5 --- .../mocks/config_store_copies_guard_test.go | 13 +- internal/server/test_helpers_test.go | 284 +----------------- 2 files changed, 18 insertions(+), 279 deletions(-) diff --git a/internal/mocks/config_store_copies_guard_test.go b/internal/mocks/config_store_copies_guard_test.go index a5a83ff26..4f4655bd1 100644 --- a/internal/mocks/config_store_copies_guard_test.go +++ b/internal/mocks/config_store_copies_guard_test.go @@ -11,13 +11,12 @@ import ( "testing" ) -// handRolledConfigStoreAllowlist lists the hand-rolled config.StoreInterface -// copies that predate this guard and are still waiting to be folded onto -// MockConfigStore (issue #76). It may only shrink: an entry whose type no -// longer hand-rolls the interface fails the guard until it is removed here. -var handRolledConfigStoreAllowlist = map[string]bool{ - "internal/server.mockConfigStoreForHealth": true, -} +// handRolledConfigStoreAllowlist lists hand-rolled config.StoreInterface copies +// that are still waiting to be folded onto MockConfigStore (issue #76). It is +// empty now that internal/server.mockConfigStoreForHealth embeds +// MockConfigStore, and it may only shrink: an entry whose type no longer +// hand-rolls the interface fails the guard until it is removed here. +var handRolledConfigStoreAllowlist = map[string]bool{} // TestNoHandRolledConfigStoreMocks keeps test doubles of config.StoreInterface // from being written out method by method. Every such copy needs a new stub for diff --git a/internal/server/test_helpers_test.go b/internal/server/test_helpers_test.go index 521d4f5f5..cafea6c6b 100644 --- a/internal/server/test_helpers_test.go +++ b/internal/server/test_helpers_test.go @@ -4,294 +4,34 @@ import ( "context" "time" - "github.com/LeanerCloud/cloud-commitments-go/pkg/ladder" "github.com/LeanerCloud/cloud-commitments-platform/internal/config" "github.com/LeanerCloud/cloud-commitments-platform/internal/database" "github.com/LeanerCloud/cloud-commitments-platform/internal/mocks" - "github.com/jackc/pgx/v5" ) // databaseConfigStub is a type alias used in health tests to simulate pending DB config. type databaseConfigStub = database.Config -// mockConfigStoreForHealth implements config.StoreInterface for health check -// tests. It embeds mocks.MockConfigStore; the hand-written stubs below are -// being removed in favour of the embedded defaults (issue #76). +// mockConfigStoreForHealth is the config.StoreInterface double for the server +// package's health, readiness and handler tests. It embeds the shared +// mocks.MockConfigStore instead of stubbing every store method by hand, so a +// new StoreInterface method needs no change here (issue #76). Override a +// method on this type only when a test here needs a default that differs +// from MockConfigStore's. type mockConfigStoreForHealth struct { mocks.MockConfigStore } +// CleanupOldExecutions reports nothing cleaned. MockConfigStore requires an +// expectation for it, and the scheduled-cleanup handler tests call it +// without one. func (m *mockConfigStoreForHealth) CleanupOldExecutions(ctx context.Context, retentionDays int) (int64, error) { return 0, nil } +// GetStaleProcessingExchanges reports no stuck exchanges. MockConfigStore +// requires an expectation for it, and the scheduled RI-exchange tests reach it +// through alarmStaleRIExchanges without one. func (m *mockConfigStoreForHealth) GetStaleProcessingExchanges(ctx context.Context, olderThan time.Duration) ([]config.RIExchangeRecord, error) { return nil, nil } - -func (m *mockConfigStoreForHealth) CreateCloudAccount(ctx context.Context, account *config.CloudAccount) error { - return nil -} -func (m *mockConfigStoreForHealth) GetCloudAccount(ctx context.Context, id string) (*config.CloudAccount, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) GetCloudAccountByExternalID(ctx context.Context, provider, externalID string) (*config.CloudAccount, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) UpdateCloudAccount(ctx context.Context, account *config.CloudAccount) error { - return nil -} -func (m *mockConfigStoreForHealth) DeleteCloudAccount(ctx context.Context, id string) error { - return nil -} -func (m *mockConfigStoreForHealth) ListCloudAccounts(ctx context.Context, filter config.CloudAccountFilter) ([]config.CloudAccount, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) SaveAccountCredential(ctx context.Context, accountID, credentialType, encryptedBlob string) error { - return nil -} -func (m *mockConfigStoreForHealth) GetAccountCredential(ctx context.Context, accountID, credentialType string) (string, error) { - return "", nil -} -func (m *mockConfigStoreForHealth) DeleteAccountCredentials(ctx context.Context, accountID string) error { - return nil -} -func (m *mockConfigStoreForHealth) HasAccountCredentials(ctx context.Context, accountID string) (bool, error) { - return false, nil -} -func (m *mockConfigStoreForHealth) GetAccountServiceOverride(ctx context.Context, accountID, provider, service string) (*config.AccountServiceOverride, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) SaveAccountServiceOverride(ctx context.Context, override *config.AccountServiceOverride) error { - return nil -} -func (m *mockConfigStoreForHealth) DeleteAccountServiceOverride(ctx context.Context, accountID, provider, service string) error { - return nil -} -func (m *mockConfigStoreForHealth) ListAccountServiceOverrides(ctx context.Context, accountID string) ([]config.AccountServiceOverride, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) SetPlanAccounts(ctx context.Context, planID string, accountIDs []string) error { - return nil -} -func (m *mockConfigStoreForHealth) GetPlanAccounts(ctx context.Context, planID string) ([]config.CloudAccount, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) CreateAccountRegistration(_ context.Context, _ *config.AccountRegistration) error { - return nil -} -func (m *mockConfigStoreForHealth) GetAccountRegistration(_ context.Context, _ string) (*config.AccountRegistration, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) GetAccountRegistrationByToken(_ context.Context, _ string) (*config.AccountRegistration, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) ListAccountRegistrations(_ context.Context, _ config.AccountRegistrationFilter) ([]config.AccountRegistration, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) UpdateAccountRegistration(_ context.Context, _ *config.AccountRegistration) error { - return nil -} -func (m *mockConfigStoreForHealth) TransitionRegistrationStatus(_ context.Context, _ *config.AccountRegistration, _ string, _ *string) error { - return nil -} -func (m *mockConfigStoreForHealth) DeleteAccountRegistration(_ context.Context, _ string) error { - return nil -} -func (m *mockConfigStoreForHealth) UpsertRecommendations(_ context.Context, _ time.Time, _ []config.RecommendationRecord, _ []config.SuccessfulCollect) error { - return nil -} -func (m *mockConfigStoreForHealth) ListStoredRecommendations(_ context.Context, _ config.RecommendationFilter) ([]config.RecommendationRecord, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) GetRecommendationsFreshness(_ context.Context) (*config.RecommendationsFreshness, error) { - return &config.RecommendationsFreshness{}, nil -} -func (m *mockConfigStoreForHealth) SetRecommendationsCollectionError(_ context.Context, _ string) error { - return nil -} -func (m *mockConfigStoreForHealth) SetRecommendationsCollectionPartial(_ context.Context, _ *config.RecommendationsCollectionPartial) error { - return nil -} -func (m *mockConfigStoreForHealth) MarkCollectionStarted(_ context.Context) (string, bool, error) { - return "mock-owner-token", true, nil -} -func (m *mockConfigStoreForHealth) ClearCollectionStarted(_ context.Context, _ string) error { - return nil -} -func (m *mockConfigStoreForHealth) ClaimCollectionInvocation(_ context.Context, _ string) (string, bool, error) { - return mocks.MockInvocationToken, true, nil -} -func (m *mockConfigStoreForHealth) GetRIUtilizationCache(_ context.Context, _ string, _ int) (*config.RIUtilizationCacheEntry, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) UpsertRIUtilizationCache(_ context.Context, _ string, _ int, _ []byte, _ time.Time) error { - return nil -} - -// ── Purchase suppressions (Commit 2 of bulk-purchase-with-grace). -func (m *mockConfigStoreForHealth) CreateSuppression(_ context.Context, _ *config.PurchaseSuppression) error { - return nil -} -func (m *mockConfigStoreForHealth) CreateSuppressionTx(_ context.Context, _ pgx.Tx, _ *config.PurchaseSuppression) error { - return nil -} -func (m *mockConfigStoreForHealth) DeleteSuppressionsByExecution(_ context.Context, _ string) error { - return nil -} -func (m *mockConfigStoreForHealth) DeleteSuppressionsByExecutionTx(_ context.Context, _ pgx.Tx, _ string) error { - return nil -} -func (m *mockConfigStoreForHealth) ListActiveSuppressions(_ context.Context) ([]config.PurchaseSuppression, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) SavePurchaseExecutionTx(ctx context.Context, _ pgx.Tx, e *config.PurchaseExecution) error { - return m.SavePurchaseExecution(ctx, e) -} -func (m *mockConfigStoreForHealth) SaveExecutionIfStatus(ctx context.Context, e *config.PurchaseExecution, _ []string) error { - return m.SavePurchaseExecution(ctx, e) -} -func (m *mockConfigStoreForHealth) SaveExecutionIfStatusTx(ctx context.Context, _ pgx.Tx, e *config.PurchaseExecution, _ []string) error { - return m.SavePurchaseExecution(ctx, e) -} -func (m *mockConfigStoreForHealth) GetExecutionFanOutShape(_ context.Context, _ string) (string, error) { - return "", nil -} -func (m *mockConfigStoreForHealth) PinExecutionFanOutShape(_ context.Context, _ string, shape string) (string, error) { - return shape, nil -} -func (m *mockConfigStoreForHealth) RecoverReapedExecution(ctx context.Context, e *config.PurchaseExecution) error { - return m.SavePurchaseExecution(ctx, e) -} -func (m *mockConfigStoreForHealth) RecoverReapedExecutionTx(ctx context.Context, _ pgx.Tx, e *config.PurchaseExecution) error { - return m.SavePurchaseExecution(ctx, e) -} -func (m *mockConfigStoreForHealth) ListRecentSubmitsTx(ctx context.Context, _ pgx.Tx, _ string, _ time.Time) ([]config.PurchaseExecution, error) { - return m.GetPendingExecutions(ctx) -} -func (m *mockConfigStoreForHealth) WithTx(_ context.Context, fn func(tx pgx.Tx) error) error { - return fn(nil) -} - -func (m *mockConfigStoreForHealth) GetPurchaseHistoryByPurchaseID(_ context.Context, _ string) (*config.PurchaseHistoryRecord, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) MarkPurchaseRevoked(_ context.Context, _ string, _ time.Time, _ string, _ string, _ *float64, _ string) error { - return nil -} - -func (m *mockConfigStoreForHealth) FlipPurchaseRevocationInFlight(_ context.Context, _ string) error { - return nil -} - -func (m *mockConfigStoreForHealth) ClearRevocationInFlight(_ context.Context, _ string) error { - return nil -} - -func (m *mockConfigStoreForHealth) GetPurchaseHistoryInFlight(_ context.Context) ([]*config.PurchaseHistoryRecord, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) GetScheduledExecutionsDue(_ context.Context) ([]config.PurchaseExecution, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) GetLadderConfigs(_ context.Context) ([]config.LadderConfigDB, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) GetLadderConfig(_ context.Context, _, _ string) (*config.LadderConfigDB, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) UpsertLadderConfig(_ context.Context, cfg *config.LadderConfigDB) (*config.LadderConfigDB, error) { - return cfg, nil -} -func (m *mockConfigStoreForHealth) SaveLadderRun(_ context.Context, run *config.LadderRunDB) (*config.LadderRunDB, error) { - return run, nil -} -func (m *mockConfigStoreForHealth) PlanAndSaveLadderRun(_ context.Context, _ string, _ time.Time, build config.LadderPlanBuilder) (*config.LadderRunDB, error) { - run, _, err := build(nil) - return run, err -} -func (m *mockConfigStoreForHealth) GetLadderRun(_ context.Context, _ string) (*config.LadderRunDB, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) SaveLadderTranches(_ context.Context, _ []config.LadderTrancheDB) error { - return nil -} -func (m *mockConfigStoreForHealth) LatestLadderRunStartedAt(_ context.Context, _ string) (*time.Time, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) TransitionLadderRunStatus(_ context.Context, _ string, _ []ladder.RunStatus, _ ladder.RunStatus) (*config.LadderRunDB, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) CancelLadderRun(_ context.Context, _ string, _ []ladder.RunStatus, _ string) (*config.LadderRunDB, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) UpdateGlobalConfigAtomic(_ context.Context, apply func(*config.GlobalConfig) error) (*config.GlobalConfig, error) { - cfg := &config.GlobalConfig{} - if err := apply(cfg); err != nil { - return nil, err - } - return cfg, nil -} -func (m *mockConfigStoreForHealth) UpdatePurchaseHistoryListing(_ context.Context, _, _, _ string) error { - return nil -} -func (m *mockConfigStoreForHealth) GetMarketplaceListingAttempt(_ context.Context, _ string) (*config.MarketplaceListingAttempt, error) { - return nil, nil -} -func (m *mockConfigStoreForHealth) ResolveMarketplaceListingAttempt(_ context.Context, _ string, _ config.MarketplaceListingAttempt, _, _ string) (bool, error) { - return false, nil -} -func (m *mockConfigStoreForHealth) ClaimMarketplaceListingSlot(_ context.Context, _, _ string, _ []byte) (*config.MarketplaceListingClaim, error) { - return &config.MarketplaceListingClaim{}, nil -} - -func (m *mockConfigStoreForHealth) ReleaseMarketplaceListingClaim(_ context.Context, _, _, _ string, _ bool) error { - return nil -} - -func (m *mockConfigStoreForHealth) ClaimRIExchangeIdempotencyKey(_ context.Context, _ string, _ time.Duration) (bool, error) { - return true, nil -} - -func (m *mockConfigStoreForHealth) StampOfferingClass(_ context.Context, _, _ string) error { - return nil -} - -func (m *mockConfigStoreForHealth) UpsertNotificationMute(_ context.Context, _, _, _ string) error { - return nil -} - -func (m *mockConfigStoreForHealth) IsNotificationMuted(_ context.Context, _, _ string) (bool, error) { - return false, nil -} - -func (m *mockConfigStoreForHealth) ListExecutionsForPlanStepTx(_ context.Context, _ pgx.Tx, _ string, _ int) ([]config.PurchaseExecution, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) SetPlanRampBaselineTx(_ context.Context, _ pgx.Tx, _ string, _ config.PlanRampBaseline) (bool, error) { - return false, nil -} - -func (m *mockConfigStoreForHealth) GetPlanRampBaselineTx(_ context.Context, _ pgx.Tx, _ string) (config.PlanRampBaseline, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) ListPlanCommittedTx(_ context.Context, _ pgx.Tx, _ string) (map[string]config.PlanRampQuantity, error) { - return nil, nil -} - -func (m *mockConfigStoreForHealth) CompleteTargetMetStepTx(_ context.Context, _ pgx.Tx, _ string, _ int, _, _ string) error { - return nil -} - -func (m *mockConfigStoreForHealth) SetExecutionRecommendationsIfEmptyTx(_ context.Context, _ pgx.Tx, _ string, _ []config.RecommendationRecord, _, _ float64) (bool, error) { - return false, nil -} - -func (m *mockConfigStoreForHealth) ExpireExecutionAtomic(_ context.Context, _ pgx.Tx, _ string) (bool, error) { - return false, nil -}