This PR addresses issue #4340 by extending error logging during the average pageviews update process in the UpdateCourseStats service. The method update_average_pageviews now includes the update_service parameter when calling AverageViewsImporter.update_outdated_average_views, allowing for improved tracking of errors and Sentry IDs during the course data update process.
I have implemented an isolated test (update_course_stats_average_views_importer_spec.rb) for the update_average_pageviews method within the UpdateCourseStats class. The test validates two main functionalities:
-Updating Outdated Average Views: The test ensures that the AverageViewsImporter.update_outdated_average_views method is called with the correct parameters, specifically checking that it receives the list of articles associated with the course and the update_service instance.
-Logging Progress: The test verifies that the progress of updating average pageviews is logged correctly. This includes checking that the log_update_progress method is invoked with the expected symbol:average_pageviews_updated.
This PR addresses issue #4340 by extending error logging during the average pageviews update process in the
UpdateCourseStats service
. The methodupdate_average_pageviews
now includes theupdate_service
parameter when callingAverageViewsImporter.update_outdated_average_views
, allowing for improved tracking of errors and Sentry IDs during the course data update process.I have implemented an isolated test (
update_course_stats_average_views_importer_spec.rb
) for theupdate_average_pageviews
method within the UpdateCourseStats class. The test validates two main functionalities:-Updating Outdated Average Views: The test ensures that the
AverageViewsImporter.update_outdated_average_views
method is called with the correct parameters, specifically checking that it receives the list of articles associated with the course and theupdate_service
instance.-Logging Progress: The test verifies that the progress of updating average pageviews is logged correctly. This includes checking that the
log_update_progress
method is invoked with the expected symbol:average_pageviews_updated
.