Bug 15200 - t/Creators.t fails when using build-git-snapshot
Summary: t/Creators.t fails when using build-git-snapshot
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Mirko Tietgen
QA Contact: Galen Charlton
URL:
Whiteboard:
Keywords:
: 17046 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-11-17 17:02 UTC by Mirko Tietgen
Modified: 2017-06-14 22:17 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 15200 - t/Creators.t fails when using build-git-snapshot (1.37 KB, patch)
2016-08-09 09:53 UTC, Mirko Tietgen
Details | Diff | Splinter Review
Bug 15200 - t/Creators.t fails when using build-git-snapshot (1.44 KB, patch)
2016-08-11 10:00 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15200 - t/Creators.t fails when using build-git-snapshot (1.47 KB, patch)
2016-11-22 20:57 UTC, Mirko Tietgen
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mirko Tietgen 2015-11-17 17:02:55 UTC
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.
Comment 1 Liz Rea 2015-11-17 20:36:51 UTC
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
Comment 2 Mirko Tietgen 2015-11-17 22:18:32 UTC
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?
Comment 3 Liz Rea 2015-11-17 22:24:09 UTC
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.
Comment 4 Mirko Tietgen 2016-08-08 12:16:19 UTC
Building packages should work without Koha installed anyway. And no other test fails for that, just this one. This needs to be fixed.
Comment 5 Mirko Tietgen 2016-08-08 12:16:36 UTC
*** Bug 17046 has been marked as a duplicate of this bug. ***
Comment 6 Mirko Tietgen 2016-08-08 13:39:11 UTC
Does it need to mock C4::Context maybe? That seems to be what other tests do.
Comment 7 Jonathan Druart 2016-08-09 08:58:54 UTC
Do you have ttf-dejavu installed?
Does /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf exist?
Comment 8 Nightly Build Bot 2016-08-09 09:26:59 UTC
HA! ttf-dejavu is missing from builddeps. I will send a patch. Thanks Jonathan!
Comment 9 Mirko Tietgen 2016-08-09 09:28:16 UTC
Errr, account fail. That was me. :D
Comment 10 Mirko Tietgen 2016-08-09 09:53:30 UTC Comment hidden (obsolete)
Comment 11 Mirko Tietgen 2016-08-09 15:39:03 UTC
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.
Comment 12 Liz Rea 2016-08-09 21:53:15 UTC
You have no idea how relevant this was to me just now. :)
Comment 13 Mirko Tietgen 2016-08-09 22:09:07 UTC
Timing is everything :)
Comment 14 Jonathan Druart 2016-08-11 10:00:21 UTC
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>
Comment 15 Jonathan Druart 2016-08-11 10:02:57 UTC
Skipping QA.
Comment 16 Kyle M Hall 2016-08-16 16:45:23 UTC
Pushed to master for 16.11, thanks Mirko!
Comment 17 Frédéric Demians 2016-08-23 10:21:29 UTC
Is relevant for 16.05? It doesn't apply as it is on stable branch.
Comment 18 Mirko Tietgen 2016-11-22 20:57:26 UTC
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>
Comment 19 Mirko Tietgen 2016-11-22 20:58:58 UTC
This one applies to 16.05
Comment 20 Mirko Tietgen 2016-12-02 22:58:19 UTC
Still needed for 16.05, package build fails.
Comment 21 Mason James 2016-12-12 17:18:12 UTC
(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
Comment 22 Julian Maurice 2016-12-19 12:08:08 UTC
Pushed to 3.22.x for 3.22.14