Skip to content

Commit

Permalink
TMP: log everything
Browse files Browse the repository at this point in the history
  • Loading branch information
rgarner committed Feb 5, 2025
1 parent ff7d601 commit 90c02c2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/services/forecast_history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def set_value(value)

return if latest_entry&.value == value

puts "Setting forecast to #{value}"
if record_history?
update_history(latest_entry, value)
else
Expand Down
1 change: 1 addition & 0 deletions spec/models/activity_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1509,6 +1509,7 @@
describe "#variance_for_report_financial_quarter" do
before do
start_of_third_quarter = Date.parse("2020-10-01")
puts "Travelling to #{start_of_third_quarter}"
travel_to start_of_third_quarter
end

Expand Down
14 changes: 14 additions & 0 deletions spec/support/log_failing.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
RSpec.configure do |config|
config.around(:each, :xfailing) do |example|
original_logger = ActiveRecord::Base.logger

ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Base.logger.level = Logger::DEBUG

begin
example.run
ensure
ActiveRecord::Base.logger = original_logger
end
end
end
4 changes: 4 additions & 0 deletions spec/support/reporting_cycle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ def tick
private

def approve_report
puts "Approving report"
@report&.update!(state: :approved)
end

def create_report
@report = Report.new(fund: @activity.associated_fund, organisation: @activity.organisation)

puts "Creating report for #{@financial_year.to_i}, Q#{@financial_quarter.to_i}"
@report.created_at = FinancialQuarter.new(@financial_year.to_i, @financial_quarter.to_i).start_date
@report.financial_quarter = @financial_quarter
@report.financial_year = @financial_year
Expand All @@ -32,11 +34,13 @@ def create_report
end

def increment_quarter
print "Incrementing quarter #{@financial_year.to_i} Q#{@financial_quarter.to_i} -> "
@financial_quarter += 1

if @financial_quarter > 4
@financial_year += 1
@financial_quarter = 1
end
puts "#{@financial_year.to_i} Q#{@financial_quarter.to_i}"
end
end

0 comments on commit 90c02c2

Please sign in to comment.