When trying to build a Debian package from git with build-git-snapshot, t/Creators.t fails and packages won't build. ERROR in koha-conf.xml -- missing <font type="H">/path/to/font.ttf</font> at /tmp/buildd/koha-3.22~beta+20151117174350.71ed2e4f/blib/PERL_MODULE_DIR/C4/Creators/PDF.pm line 123. ERROR in koha-conf.xml -- missing <font type="H">/path/to/font.ttf</font> at /tmp/buildd/koha-3.22~beta+20151117174350.71ed2e4f/blib/PERL_MODULE_DIR/C4/Creators/PDF.pm line 123. # Failed test 'testing StrWidth() returns correct point width' # at t/Creators.t line 55. # got: '19.344' # expected: '23.044921875' # Failed test 'testing Text() writes to the correct x-value' # at t/Creators.t line 59. # got: '29.344' # expected: '33.044921875' ERROR in koha-conf.xml -- missing <font type="TR">/path/to/font.ttf</font> at /tmp/buildd/koha-3.22~beta+20151117174350.71ed2e4f/blib/PERL_MODULE_DIR/C4/Creators/PDF.pm line 123. ERROR in koha-conf.xml -- missing <font type="TB">/path/to/font.ttf</font> at /tmp/buildd/koha-3.22~beta+20151117174350.71ed2e4f/blib/PERL_MODULE_DIR/C4/Creators/PDF.pm line 123. ERROR in koha-conf.xml -- missing <font type="TI">/path/to/font.ttf</font> at /tmp/buildd/koha-3.22~beta+20151117174350.71ed2e4f/blib/PERL_MODULE_DIR/C4/Creators/PDF.pm line 123. ERROR in koha-conf.xml -- missing <font type="TBI">/path/to/font.ttf</font> at /tmp/buildd/koha-3.22~beta+20151117174350.71ed2e4f/blib/PERL_MODULE_DIR/C4/Creators/PDF.pm line 123. ERROR in koha-conf.xml -- missing <font type="C">/path/to/font.ttf</font> at /tmp/buildd/koha-3.22~beta+20151117174350.71ed2e4f/blib/PERL_MODULE_DIR/C4/Creators/PDF.pm line 123. ERROR in koha-conf.xml -- missing <font type="CB">/path/to/font.ttf</font> at /tmp/buildd/koha-3.22~beta+20151117174350.71ed2e4f/blib/PERL_MODULE_DIR/C4/Creators/PDF.pm line 123. ERROR in koha-conf.xml -- missing <font type="CO">/path/to/font.ttf</font> at /tmp/buildd/koha-3.22~beta+20151117174350.71ed2e4f/blib/PERL_MODULE_DIR/C4/Creators/PDF.pm line 123. ERROR in koha-conf.xml -- missing <font type="CBO">/path/to/font.ttf</font> at /tmp/buildd/koha-3.22~beta+20151117174350.71ed2e4f/blib/PERL_MODULE_DIR/C4/Creators/PDF.pm line 123. ERROR in koha-conf.xml -- missing <font type="H">/path/to/font.ttf</font> at /tmp/buildd/koha-3.22~beta+20151117174350.71ed2e4f/blib/PERL_MODULE_DIR/C4/Creators/PDF.pm line 123. ERROR in koha-conf.xml -- missing <font type="HO">/path/to/font.ttf</font> at /tmp/buildd/koha-3.22~beta+20151117174350.71ed2e4f/blib/PERL_MODULE_DIR/C4/Creators/PDF.pm line 123. ERROR in koha-conf.xml -- missing <font type="HB">/path/to/font.ttf</font> at /tmp/buildd/koha-3.22~beta+20151117174350.71ed2e4f/blib/PERL_MODULE_DIR/C4/Creators/PDF.pm line 123. ERROR in koha-conf.xml -- missing <font type="HBO">/path/to/font.ttf</font> at /tmp/buildd/koha-3.22~beta+20151117174350.71ed2e4f/blib/PERL_MODULE_DIR/C4/Creators/PDF.pm line 123. Wide character in compress at /usr/share/perl5/PDF/Reuse.pm line 820. # Looks like you planned 41 tests but ran 39. # Looks like you failed 2 tests of 39 run. # Looks like your test exited with 25 just after 39.
Mirko, Are you using a most up-to-date koha-conf.xml when you are building your git snapshot? If you don't have these font values in there (or you don't have your KOHA_CONF env exported) this test will fail. If they are in there, then yeah, you've got a problem. :) Liz
The font stuff is in the koha-conf.xml > <font type="H" >/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf</font> etc. I will check the KOHA_CONF tomorrow, but I suspect more things would fail without that?
Generating PDF's without encoding issues would be a problem, for sure. This is kind of an ongoing problem, how to make sure we've got the latest stuff in koha-conf.xml as we pass through versions. I think Magnus had a solution for it at one point.
Building packages should work without Koha installed anyway. And no other test fails for that, just this one. This needs to be fixed.
*** Bug 17046 has been marked as a duplicate of this bug. ***
Does it need to mock C4::Context maybe? That seems to be what other tests do.
Do you have ttf-dejavu installed? Does /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf exist?
HA! ttf-dejavu is missing from builddeps. I will send a patch. Thanks Jonathan!
Errr, account fail. That was me. :D
Created attachment 54192 [details] [review] Bug 15200 - t/Creators.t fails when using build-git-snapshot ttf-dejavu was missing from the build dependencies.
Possible test: Use build-git-snapshot before applying the patch, see t/Creators.t fail. Apply patch. Run build-git-snapshot again. t/Creators.t does not fail.
You have no idea how relevant this was to me just now. :)
Timing is everything :)
Created attachment 54291 [details] [review] Bug 15200 - t/Creators.t fails when using build-git-snapshot ttf-dejavu was missing from the build dependencies. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Skipping QA.
Pushed to master for 16.11, thanks Mirko!
Is relevant for 16.05? It doesn't apply as it is on stable branch.
Created attachment 57716 [details] [review] Bug 15200 - t/Creators.t fails when using build-git-snapshot ttf-dejavu was missing from the build dependencies. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This one applies to 16.05
Still needed for 16.05, package build fails.
(In reply to Mirko Tietgen from comment #20) > Still needed for 16.05, package build fails. Pushed to 16.05.x, will be in 16.05.06
Pushed to 3.22.x for 3.22.14