Bug 6796 introduced the first use of this DB column type, and TestBuilder is just not ready for it: https://jenkins.koha-community.org/job/Koha_Master_D10/lastCompletedBuild/console we should add support.
Created attachment 164871 [details] [review] Bug 36593: Add 'time' column type support to TestBuilder This simple patch adds support for the 'time' column type. To test: 1. Run: $ ktd --shell k$ perl -Mt::lib::TestBuilder -e 'my $b = t::lib::TestBuilder->new; my $hour = $b->build_object({ class => "Koha::Library::Hours" });' => FAIL: It explodes as it doesn't know how to deal with the 'time' column type 2. Apply this patch and the follow-up 3. Run: k$ prove -MDDP -Mt::lib::TestBuilder -e 'my $b = t::lib::TestBuilder->new; my $h = $b->build_object({ class => "Koha::Library::Hours" }); p($h->unblessed);' => SUCCESS: It generates an hour! 4. Run: k$ prove t/db_dependent/TestBuilder.t => SUCCESS: It builds all the things! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 164872 [details] [review] Bug 36593: Add missing koha_object(s)_class methods to LibraryHour.pm (bug 9796) Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 164881 [details] [review] Bug 36593: Add 'time' column type support to TestBuilder This simple patch adds support for the 'time' column type. To test: 1. Run: $ ktd --shell k$ perl -Mt::lib::TestBuilder -e 'my $b = t::lib::TestBuilder->new; my $hour = $b->build_object({ class => "Koha::Library::Hours" });' => FAIL: It explodes as it doesn't know how to deal with the 'time' column type 2. Apply this patch and the follow-up 3. Run: k$ prove -MDDP -Mt::lib::TestBuilder -e 'my $b = t::lib::TestBuilder->new; my $h = $b->build_object({ class => "Koha::Library::Hours" }); p($h->unblessed);' => SUCCESS: It generates an hour! 4. Run: k$ prove t/db_dependent/TestBuilder.t => SUCCESS: It builds all the things! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 164882 [details] [review] Bug 36593: Add missing koha_object(s)_class methods to LibraryHour.pm (bug 9796) Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Good spot, thanks for the quick follow-up Tomas. Passing QA directly.
I am expecting regressions from this, did you run the whole test suite? If you set all dates to now, you will have problems in the circulation, holds, etc. logic. Am I missing something?
(In reply to Jonathan Druart from comment #6) > I am expecting regressions from this, did you run the whole test suite? > > If you set all dates to now, you will have problems in the circulation, > holds, etc. logic. Am I missing something? I'm not touching anything for existing behavior. This is replicating it for 'time' only. The only 'time' column is this new one. Though, the fact TestBuilder cannot build 'Koha::Library::Hour' objects implies... there are no good tests for this feature?
Right, ignore me!
Well.. yes and no regards tests.. They didn't add the relations so there aren't tests for that and the tests that are added account for changes in Circulation.pm and didn't need mocking.. We could always do with more tests though.. and I'd like to see more of the logic moved back out of controllers into classes.
Pushed for 24.05! Well done everyone, thank you!
Not backported to 23.11.x
Test suite changes don't induce changes to the manual afaik. Closing, but feel free to reopen if the status was put there to document something in the coding guidelines