chore: remove prompt enable outside resuce
This commit is contained in:
@@ -187,9 +187,10 @@ class ReportingEventsRollupBackfill # rubocop:disable Metrics/ClassLength
|
||||
end
|
||||
|
||||
print_success(account, days_processed, total_days, Time.current - start_time)
|
||||
prompt_enable_rollup_read_path(account)
|
||||
rescue StandardError => e
|
||||
print_failure(e, days_processed, total_days)
|
||||
else
|
||||
prompt_enable_rollup_read_path(account)
|
||||
end
|
||||
|
||||
def print_success(account, days_processed, _total_days, elapsed_time)
|
||||
|
||||
@@ -31,6 +31,16 @@ describe ReportingEventsRollupBackfill do
|
||||
service.send(:execute_backfill, account, date, date, 1)
|
||||
end.to raise_error(SystemExit)
|
||||
end
|
||||
|
||||
it 'does not report the backfill as failed when enabling the read path fails' do
|
||||
allow(service).to receive(:print_success)
|
||||
allow(service).to receive(:print_failure)
|
||||
allow(service).to receive(:prompt_enable_rollup_read_path).and_raise(StandardError, 'toggle failed')
|
||||
|
||||
expect do
|
||||
service.send(:execute_backfill, account, date, date, 1)
|
||||
end.to raise_error(StandardError, 'toggle failed')
|
||||
end
|
||||
end
|
||||
|
||||
describe '#prompt_enable_rollup_read_path' do
|
||||
@@ -49,5 +59,13 @@ describe ReportingEventsRollupBackfill do
|
||||
|
||||
service.send(:prompt_enable_rollup_read_path, account)
|
||||
end
|
||||
|
||||
it 'skips the prompt when the feature is already enabled' do
|
||||
allow(account).to receive(:feature_enabled?).with(:reporting_events_rollup).and_return(true)
|
||||
|
||||
expect($stdin).not_to receive(:gets)
|
||||
|
||||
service.send(:prompt_enable_rollup_read_path, account)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user