Description
Kyle M Hall (khall)
2024-07-24 12:11:47 UTC
Created attachment 169472 [details] [review] Bug 37448 - Add script to allow developers to quickly generate large amounts of data for development and testing Test Plan: 1) Apply this patch 2) Run: misc/devel/create_test_data.pl -n 99 -s Borrower -d surname=Hall -d zipcode=111111 3) Search patrons' for the name "Hall" 4) Note there are 99 Hall's in your results! Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 169474 [details] [review] Bug 37448 - Add script to allow developers to quickly generate large amounts of data for development and testing Test Plan: 1) Apply this patch 2) Run: misc/devel/create_test_data.pl -n 99 -s Borrower -d surname=Hall -d zipcode=111111 3) Search patrons' for the name "Hall" 4) Note there are 99 Hall's in your results! Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 169486 [details] [review] Bug 37448 - Add script to allow developers to quickly generate large amounts of data for development and testing Test Plan: 1) Apply this patch 2) Run: misc/devel/create_test_data.pl -n 99 -s Borrower -d surname=Hall -d zipcode=111111 3) Search patrons' for the name "Hall" 4) Note there are 99 Hall's in your results! Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Created attachment 169487 [details] [review] Bug 37448: Make use of build_sample_biblio and build_sample_item The script is brilliant, but for biblios and items we should make use of build_sample_biblio and build_sample_item or this data does not get indexed + linked tables rows get missed To test, before this patch, run: 1) misc/devel/create_test_data.pl -n 5 -s Biblio -d title=Test Notice the 'Test' biblio is created on the database, but doesnt show on searches, and accessing it directly through URL throws a 500 error (because metadata does not exist for the biblio) 2) Apply this patch. Repeat the step above. Notice it now shows on searches and visiting the biblio directly shows no errors Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Side info: Enabling ILL and installing FreeForm by running: bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh) If we then run: misc/devel/create_test_data.pl -n 99 -s Illrequest -d backend=FreeForm It works beautifully, and although not an exact 1 to 1 to what I did at https://github.com/ammopt/koha-ill-dev/blob/master/lib/KohaFactory/ILL.pm This way using the test builder instead is much more elegant and practical. Thanks Kyle this is awesome. Created attachment 169488 [details] [review] Bug 37448: Make use of build_sample_biblio and build_sample_item The script is brilliant, but for biblios and items we should make use of build_sample_biblio and build_sample_item or this data does not get indexed + linked tables rows get missed To test, before this patch, run: 1) misc/devel/create_test_data.pl -n 5 -s Biblio -d title=Test Notice the 'Test' biblio is created on the database, but doesnt show on searches, and accessing it directly through URL throws a 500 error (because metadata does not exist for the biblio) 2) Apply this patch. Repeat the step above. Notice it now shows on searches and visiting the biblio directly shows no errors Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 169489 [details] [review] Bug 37448: Make use of build_sample_biblio and build_sample_item The script is brilliant, but for biblios and items we should make use of build_sample_biblio and build_sample_item or this data does not get indexed + linked tables rows get missed To test, before this patch, run: 1) misc/devel/create_test_data.pl -n 5 -s Biblio -d title=Test Notice the 'Test' biblio is created on the database, but doesnt show on searches, and accessing it directly through URL throws a 500 error (because metadata does not exist for the biblio) 2) Apply this patch. Repeat the step above. Notice it now shows on searches and visiting the biblio directly shows no errors Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Thanks for the excellent followup Pedro! Created attachment 169490 [details] [review] Bug 37448: Add build_sample_ill_request The linked biblio_id of a generated test ILL request needs to be created by build_sample_biblio->AddBiblio. Or else the related biblio is created by just 'build' and is not indexed + its related metadata is missing. To test: 1) Enabling ILL and installing FreeForm by running: bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh) 2) Run the script for ILL requests: misc/devel/create_test_data.pl -n 5 -s Illrequest -d backend=FreeForm 3) Visit the ILLModule: http://<intra_url>/cgi-bin/koha/ill/ill-requests.pl 4) Notice it loads 5 test ILL requests correctly Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Apologies for the additional follow-up, but upon further testing this is required for ILL requests I want to make use of this script for ILL testing (!). Created attachment 169550 [details] [review] Bug 37448 - Add script to allow developers to quickly generate large amounts of data for development and testing Test Plan: 1) Apply this patch 2) Run: misc/devel/create_test_data.pl -n 99 -s Borrower -d surname=Hall -d zipcode=111111 3) Search patrons' for the name "Hall" 4) Note there are 99 Hall's in your results! Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Created attachment 169551 [details] [review] Bug 37448: Make use of build_sample_biblio and build_sample_item The script is brilliant, but for biblios and items we should make use of build_sample_biblio and build_sample_item or this data does not get indexed + linked tables rows get missed To test, before this patch, run: 1) misc/devel/create_test_data.pl -n 5 -s Biblio -d title=Test Notice the 'Test' biblio is created on the database, but doesnt show on searches, and accessing it directly through URL throws a 500 error (because metadata does not exist for the biblio) 2) Apply this patch. Repeat the step above. Notice it now shows on searches and visiting the biblio directly shows no errors Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 169552 [details] [review] Bug 37448: Add build_sample_ill_request The linked biblio_id of a generated test ILL request needs to be created by build_sample_biblio->AddBiblio. Or else the related biblio is created by just 'build' and is not indexed + its related metadata is missing. To test: 1) Enabling ILL and installing FreeForm by running: bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh) 2) Run the script for ILL requests: misc/devel/create_test_data.pl -n 5 -s Illrequest -d backend=FreeForm 3) Visit the ILLModule: http://<intra_url>/cgi-bin/koha/ill/ill-requests.pl 4) Notice it loads 5 test ILL requests correctly Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 169553 [details] [review] Bug 37448: (QA follow-up) Tidy script Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Adding others here, anyone available for QA? Created attachment 174526 [details] [review] Bug 37448: (QA follow-up) Use Standard instead of FreeForm Standard is now part of core Koha after 35570. Use that instead of relying on having FreeForm installed kohadev-koha@kohadevbox:koha(bug_37448)$ qa testing 4 commit(s) (applied to 27e8543 '91 Bug 38011: Fix ReNewSubscription.t') Processing files before patches |========================>| 2 / 2 (100.00%) Processing files after patches |========================>| 2 / 2 (100.00%) FAIL misc/devel/create_test_data.pl FAIL spelling specificed ==> specified FAIL t/lib/TestBuilder.pm FAIL pod coverage POD is missing for build_sample_ill_request Processing additional checks * Commit title does not start with 'Bug XXXXX: ' - 03bfa19676 * Was this bug sponsored by anyone? Created attachment 174528 [details] [review] Bug 37448: (QA follow-up) Squashed follow-ups: - Use Standard instead of FreeForm -- Standard is now part of core Koha after 35570. Use that instead of relying on having FreeForm installed - Add POD to build_sample_ill_request - Use build_object instead of build -> return a Koha::ILL::Request obj instead of unblessed. - Squashed typo fix in create_test_data.pl koha-jump plugin had that in mind. And I think this kind of scripts should be kept outside of the main repo. Mainly because it won't require SO+QA+RM on it, and make it easier to improve/contribute Only giving my opinion here. (In reply to Jonathan Druart from comment #19) > koha-jump plugin had that in mind. > > And I think this kind of scripts should be kept outside of the main repo. > Mainly because it won't require SO+QA+RM on it, and make it easier to > improve/contribute > > Only giving my opinion here. Fair. Agreed. Should we push this to https://gitlab.com/koha-community/koha-misc4dev instead? I'd like to still have have build_sample_ill_request in core though to be used for tests. Does that sound sensible? A separate plugin would certainly be better IMO. But we could accept a koha-misc4dev merge-request as a short-term solution. > I'd like to still have have build_sample_ill_request in core though to be used for tests. Does that sound sensible?
Yes sure!
Created attachment 174834 [details] [review] [DONT PUSH] Bug 37448: Add script to allow developers to quickly generate large amounts of data for development and testing Test Plan: 1) Apply this patch 2) Run: misc/devel/create_test_data.pl -n 99 -s Borrower -d surname=Hall -d zipcode=111111 3) Search patrons' for the name "Hall" 4) Note there are 99 Hall's in your results! Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Bug 37448: Make use of build_sample_biblio and build_sample_item The script is brilliant, but for biblios and items we should make use of build_sample_biblio and build_sample_item or this data does not get indexed + linked tables rows get missed To test, before this patch, run: 1) misc/devel/create_test_data.pl -n 5 -s Biblio -d title=Test Notice the 'Test' biblio is created on the database, but doesnt show on searches, and accessing it directly through URL throws a 500 error (because metadata does not exist for the biblio) 2) Apply this patch. Repeat the step above. Notice it now shows on searches and visiting the biblio directly shows no errors Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Bug 37448: (QA follow-up) Tidy script Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 174835 [details] [review] Bug 37448: Add build_sample_ill_request The linked biblio_id of a generated test ILL request needs to be created by build_sample_biblio->AddBiblio. Or else the related biblio is created by just 'build' and is not indexed + its related metadata is missing. To test: 1) Apply the [DONT PUSH] patch and enable ILLModule 2) Run the script for ILL requests: misc/devel/create_test_data.pl -n 5 -s Illrequest -d backend=Standard 3) Visit the ILLModule: http://<intra_url>/cgi-bin/koha/ill/ill-requests.pl 4) Notice it loads 5 test ILL requests correctly Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> I've kept the original patch as [DONT PUSH] to be later added to misc4dev or a plugin. |