Skip to content

Commit 2bd1dfb

Browse files
committed
Let other config keys through the skip_was_running_backfill stub
The three seed migration specs stub Config#get so that only :skip_was_running_backfill is allowed. After each example the shared migration context runs every newer migration. Main now has 20260811120000_add_root_job_guid_to_jobs, which on Postgres calls Config#get(:migration_psql_concurrent_statement_timeout_in_seconds). The stub rejected that call, so the three specs failed on Postgres only. The stub now calls the real method for every other key.
1 parent 7e85936 commit 2bd1dfb

3 files changed

Lines changed: 3 additions & 0 deletions

spec/migrations/20260601120100_seed_was_running_app_usage_events_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def seed_app_event(suffix, state:, app_guid:)
150150

151151
context 'when skip_was_running_backfill is set' do
152152
before do
153+
allow_any_instance_of(VCAP::CloudController::Config).to receive(:get).and_call_original
153154
allow_any_instance_of(VCAP::CloudController::Config).to receive(:get).with(:skip_was_running_backfill).and_return(true)
154155
end
155156

spec/migrations/20260601120200_seed_was_running_service_usage_events_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ def seed_service_event(suffix, state:, service_instance_guid:)
105105

106106
context 'when skip_was_running_backfill is set' do
107107
before do
108+
allow_any_instance_of(VCAP::CloudController::Config).to receive(:get).and_call_original
108109
allow_any_instance_of(VCAP::CloudController::Config).to receive(:get).with(:skip_was_running_backfill).and_return(true)
109110
end
110111

spec/migrations/20260601120300_seed_was_running_task_usage_events_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def seed_task_event(suffix, state:, task_guid:)
106106

107107
context 'when skip_was_running_backfill is set' do
108108
before do
109+
allow_any_instance_of(VCAP::CloudController::Config).to receive(:get).and_call_original
109110
allow_any_instance_of(VCAP::CloudController::Config).to receive(:get).with(:skip_was_running_backfill).and_return(true)
110111
end
111112

0 commit comments

Comments
 (0)