Browse Source

Add more logging for the exports (#1862)

pull/1863/head
kosiakkatrina 1 year ago committed by GitHub
parent
commit
07a6e5a719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      app/services/exports/lettings_log_export_service.rb
  2. 2
      spec/services/exports/lettings_log_export_service_spec.rb

1
app/services/exports/lettings_log_export_service.rb

@ -105,6 +105,7 @@ module Exports
zip_file.add("#{archive}_#{part_number_str}.xml", data_xml) zip_file.add("#{archive}_#{part_number_str}.xml", data_xml)
part_number += 1 part_number += 1
last_processed_marker = lettings_logs_slice.last.created_at last_processed_marker = lettings_logs_slice.last.created_at
@logger.info("Added #{archive}_#{part_number_str}.xml")
end end
# Required by S3 to avoid Aws::S3::Errors::BadDigest # Required by S3 to avoid Aws::S3::Errors::BadDigest

2
spec/services/exports/lettings_log_export_service_spec.rb

@ -208,9 +208,11 @@ RSpec.describe Exports::LettingsLogExportService do
expect(storage_service).to receive(:write_file).with(expected_zip_filename2, any_args) expect(storage_service).to receive(:write_file).with(expected_zip_filename2, any_args)
expect(Rails.logger).to receive(:info).with("Building export run for 2021") expect(Rails.logger).to receive(:info).with("Building export run for 2021")
expect(Rails.logger).to receive(:info).with("Creating core_2021_2022_apr_mar_f0001_inc0001 - 1 logs") expect(Rails.logger).to receive(:info).with("Creating core_2021_2022_apr_mar_f0001_inc0001 - 1 logs")
expect(Rails.logger).to receive(:info).with("Added core_2021_2022_apr_mar_f0001_inc0001_pt001.xml")
expect(Rails.logger).to receive(:info).with("Writing core_2021_2022_apr_mar_f0001_inc0001.zip") expect(Rails.logger).to receive(:info).with("Writing core_2021_2022_apr_mar_f0001_inc0001.zip")
expect(Rails.logger).to receive(:info).with("Building export run for 2022") expect(Rails.logger).to receive(:info).with("Building export run for 2022")
expect(Rails.logger).to receive(:info).with("Creating core_2022_2023_apr_mar_f0001_inc0001 - 1 logs") expect(Rails.logger).to receive(:info).with("Creating core_2022_2023_apr_mar_f0001_inc0001 - 1 logs")
expect(Rails.logger).to receive(:info).with("Added core_2022_2023_apr_mar_f0001_inc0001_pt001.xml")
expect(Rails.logger).to receive(:info).with("Writing core_2022_2023_apr_mar_f0001_inc0001.zip") expect(Rails.logger).to receive(:info).with("Writing core_2022_2023_apr_mar_f0001_inc0001.zip")
expect(Rails.logger).to receive(:info).with("Building export run for 2023") expect(Rails.logger).to receive(:info).with("Building export run for 2023")
expect(Rails.logger).to receive(:info).with("Creating core_2023_2024_apr_mar_f0001_inc0001 - 0 logs") expect(Rails.logger).to receive(:info).with("Creating core_2023_2024_apr_mar_f0001_inc0001 - 0 logs")

Loading…
Cancel
Save