Description
Pedro Amorim
2024-12-24 10:36:22 UTC
Created attachment 175922 [details] [review] Bug 38782: Mock userenv->{number} prove t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t Created attachment 175923 [details] [review] Bug 38782: Remove concat in background process The ud_provider->{report_type} is only defined on ->harvest_sushi, meaning it'll never be defined here. We don't need this anyway. The filename should be the filename of the file being manually uploaded. We only need this concat logic for COUNTER files being generated by Koha following a SUSHI harvest, and that works. This also gets rid of a warning when running the tests Created attachment 175924 [details] [review] Bug 38782: Apply same fix for CounterFile.t prove t/db_dependent/Koha/ERM/EUsage/CounterFile.t Created attachment 175925 [details] [review] Bug 38782: Mock userenv->{number} prove t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Edit: tidy (tcohen) Created attachment 175926 [details] [review] Bug 38782: Remove concat in background process The ud_provider->{report_type} is only defined on ->harvest_sushi, meaning it'll never be defined here. We don't need this anyway. The filename should be the filename of the file being manually uploaded. We only need this concat logic for COUNTER files being generated by Koha following a SUSHI harvest, and that works. This also gets rid of a warning when running the tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 175927 [details] [review] Bug 38782: Apply same fix for CounterFile.t prove t/db_dependent/Koha/ERM/EUsage/CounterFile.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Edit: tidy (tcohen) Created attachment 175928 [details] [review] Bug 38782: Fix erm_custom_reports.t DRY superlibrarian declarion to top for all test methods. Apply same fix from before i.e. mock_userenv prove t/db_dependent/api/v1/erm_custom_reports.t Thanks Tomas, I was missing a last (I think) test fix. Please double-check my last patch when you have the chance. Thanks! (In reply to Pedro Amorim from comment #8) > Thanks Tomas, I was missing a last (I think) test fix. Please double-check > my last patch when you have the chance. Thanks! I think it should happen inside a transaction. Created attachment 175929 [details] [review] Bug 38782: mock_userenv in API tests Reorder logic slightly for each to only create the counter_file after the mock_userenv has taken place prove t/db_dependent/api/v1/erm_custom_reports.t (In reply to Tomás Cohen Arazi (tcohen) from comment #9) > I think it should happen inside a transaction. Fair. Patch amended. Created attachment 175930 [details] [review] Bug 38782: mock_userenv in API tests Reorder logic slightly for each to only create the counter_file after the mock_userenv has taken place prove t/db_dependent/api/v1/erm_custom_reports.t Thanks Pedro! Pushed for 25.05! Well done everyone, thank you! |