We need several de-dependent tests for is_holiday. We currently only have sample data and tests for repeteable holidays. Missing: - special holidays - exception holidays
Created attachment 13451 [details] [review] Bug 9074 - DB dependent tests for is_holiday Some DB dependent tests for: - Special holidays - Exception holidays I added a test for a bug introduced by 8966. Sponsored-by: Universidad Nacional de Córdoba
The test for holiday exceptions fails, because of bug 9078 for which I'm providing a patch in a moment.
(In reply to comment #2) > The test for holiday exceptions fails, because of bug 9078 for which I'm > providing a patch in a moment. Forgot to tell that this was built against master with 8800 patch. Otherwise the test for that truncation problem fails.
git am -s /tmp/Bug-9074---DB-dependent-tests-for-isholiday-eiKuaq.patch Applying: Bug 9074 - DB dependent tests for is_holiday /home/koha/kohaclone/.git/rebase-apply/patch:101: trailing whitespace. INSERT INTO `repeatable_holidays` VALUES /home/koha/kohaclone/.git/rebase-apply/patch:134: trailing whitespace. SET FOREIGN_KEY_CHECKS=1;INSERT INTO `repeatable_holidays` VALUES /home/koha/kohaclone/.git/rebase-apply/patch:225: trailing whitespace. INSERT INTO `repeatable_holidays` VALUES /home/koha/kohaclone/.git/rebase-apply/patch:282: trailing whitespace. # is_holiday truncates the date to day as that's error: patch failed: installer/data/mysql/en/optional/sample_holidays.txt:1 error: installer/data/mysql/en/optional/sample_holidays.txt: patch does not apply /home/koha/kohaclone/.git/rebase-apply/patch:258: new blank line at EOF. + Patch failed at 0001 Bug 9074 - DB dependent tests for is_holiday
Created attachment 13586 [details] [review] Bug 9074 - DB dependent tests for is_holiday Some DB dependent tests for: - Special holidays - Exception holidays I added a test for a bug introduced by 8966. Sponsored-by: Universidad Nacional de Córdoba
Here is my output. I'm not sure if this is an error with the test, or an error in the code. perl t/db_dependent/Holidays.t 1..11 ok 1 - use Koha::Calendar; ok 2 - use C4::Calendar; ok 3 - Koha::Calendar class returned isa Koha::Calendar ok 4 - C4::Calendar class returned isa C4::Calendar ok 5 - Sunday is a closed day ok 6 - Monday is not a closed day ok 7 - Christmas is a closed day ok 8 - New Years day is a closed day ok 9 - Sample single holiday is a closed day not ok 10 - Sample sunday exception is not a closed day # Failed test 'Sample sunday exception is not a closed day' # at t/db_dependent/Holidays.t line 59. # got: '1' # expected: '0' not ok 11 - is_holiday should truncate the date for holiday validation # Failed test 'is_holiday should truncate the date for holiday validation' # at t/db_dependent/Holidays.t line 73. # got: '0' # expected: '1' # Looks like you failed 2 tests of 11.
Created attachment 13587 [details] [review] Bug 9074 - DB dependent tests for is_holiday Some DB dependent tests for: - Special holidays - Exception holidays I added a test for a bug introduced by 8966. Sponsored-by: Universidad Nacional de Córdoba Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Tests are failing due to bad code, the tests are good.
Created attachment 13609 [details] [review] Bug 9074 - DB dependent tests for is_holiday Some DB dependent tests for: - Special holidays - Exception holidays I added a test for a bug introduced by 8966. Sponsored-by: Universidad Nacional de Córdoba Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Hi Tomas, I am wondering if adding the holidays to all the translated sample data is necessary. Also a bit worried because it includes a branchcode, that I think we might need, but it is not there in most of the non-english sample holidays. Do we need to clean them up?
Katrin, we could just empty the MPL string, the only side effect would be that holidays will be set for all branches. Could it be done by the signer or should I provide a new patch?
I wonder if we should have that kind of data if it's not possible to recraete it from the interface. I tried adding a holiday with an empty branchcode - if you select 'copy to all branches' in the database an entry for each branchcode is created. So it seems our test data is wrong? I am not sure what to do here, I will concentrate on testing 8800 for now.
in conjunction with patches from 9078 please!
Created attachment 13634 [details] [review] Bug 9074 - DB dependent tests for is_holiday Some DB dependent tests for: - Special holidays - Exception holidays I added a test for a bug introduced by 8966. Languages that don't provide the MPL branch in their sample data are ommited. Sponsored-by: Universidad Nacional de Córdoba Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
I would like to change this to 'in discussion' for now - please feel free to object. Tomas has thankfully brought up the topic on the mailing list: http://lists.koha-community.org/pipermail/koha-devel/2012-November/038525.html
This bug is not being discussed. As I said in Bug 9133 we need a data set for testing purposes. That's where this should fit instead of the default standard example values. That said, I mark this resolved wontfix. If anyone feels this should be different, just change the status.