Bug 908956

Summary: The test suite fails when publican is not installed
Product: [Community] Publican Reporter: Raphaël Hertzog <raphael>
Component: publicanAssignee: Jeff Fearn 🐞 <jfearn>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.1CC: rglasz, rlandman
Target Milestone: 3.2   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 3.1.3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-05 02:16:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch to work-around the testsuite failures none

Description Raphaël Hertzog 2013-02-07 21:30:05 UTC
Description of problem:

The test suite fails when publican is not yet installed. Despite the recent fixes, this was not enough...

#   Failed test 'build a book'
#   at t/300.Builder.t line 30.
# file error - cover.tmpl: not found

This error appears several times.

Test Summary Report
-------------------
t/110.CreateBrand.t         (Wstat: 0 Tests: 4 Failed: 0)
  Parse errors: Bad plan.  You planned 5 tests but ran 4.
t/300.Builder.t             (Wstat: 256 Tests: 5 Failed: 1)
  Failed test:  4
  Non-zero exit status: 1
t/900.publican.t            (Wstat: 256 Tests: 14 Failed: 1)
  Failed test:  6
  Non-zero exit status: 1
t/910.publican.Users_Guide.t (Wstat: 256 Tests: 5 Failed: 1)
  Failed test:  5
  Non-zero exit status: 1

It looks like that publican is trying to get this file via the brand_dir which is equal to common_content which is equal to datadir in the build directory. But book_templates is actually outside of that directory (in blib/book_templates)...

I'm not sure what a proper fix would be.

That said it would be nice if you could test the test suite in a chroot where publican is not installed just to ensure that it works as expected. I got a failing testsuite for each of the release that I packaged for Debian. :-|

Comment 1 Raphaël Hertzog 2013-02-07 21:43:01 UTC
Created attachment 694806 [details]
Patch to work-around the testsuite failures

I attach the work-around that I used for now, it's just creating a symlink in the place where publican is looking for the files.

Comment 2 Raphaël Hertzog 2013-02-07 21:49:12 UTC
Forget the change about t/110.CreateBrand.t it's just wrong.

Comment 3 Raphaël Hertzog 2013-02-07 22:32:55 UTC
But there's still something fishy about this test:

# Testing Publican::CreateBrand 0.2
t/110.CreateBrand.t ........... 
Failed 1/5 subtests 

[...]

Test Summary Report
-------------------
t/110.CreateBrand.t         (Wstat: 0 Tests: 4 Failed: 0)
  Parse errors: Bad plan.  You planned 5 tests but ran 4.
Files=9, Tests=53, 97 wallclock secs ( 0.11 usr  0.00 sys + 107.19 cusr  3.32 csys = 110.62 CPU)
Result: FAIL
Failed 1/9 test programs. 0/53 subtests failed.
dh_auto_test: perl Build test returned exit code 255


Further tests revealed that the issue is a warning that confuses the Test::Harness:

$ ./Build test verbose=1
[...]
t/110.CreateBrand.t .. 
1..5
ok 1 - use Publican;
ok 2 - use Publican::CreateBrand;
ok 3 - missing mandtaor lang
ok 4 - creating a Publican::CreateBrand isa Publican::CreateBrand
WARNING: Unknow config key release, ignoring.
ok 5 - create the brand
Failed 1/5 subtests 

I fixed this with this change:
--- a/lib/Publican.pm
+++ b/lib/Publican.pm
@@ -329,6 +329,12 @@ my %PARAMS = (
         ),
         constraint => '^[0-9]',
     },
+    release => {
+        descr => maketext(
+            'RPM Release number'
+        ),
+    },
+
     web_brew_dist => {
         descr   => maketext('The brew dist to use for building the web rpm.'),
         default => 'docs-5E',

Comment 4 Jeff Fearn 🐞 2013-02-07 23:13:05 UTC
The for t/110.CreateBrand.t is to fix CreateBrand, it's setting a parameter we removed ages ago.

FWIW this test does not fail for me, it does emit the warming with vebose on though.


$ git diff lib/Publican/CreateBrand.pm
diff --git a/publican/lib/Publican/CreateBrand.pm b/publican/lib/Publican/CreateBrand.pm
index a102a0b..b606e82 100644
--- a/publican/lib/Publican/CreateBrand.pm
+++ b/publican/lib/Publican/CreateBrand.pm
@@ -75,7 +75,6 @@ sub new {
 
     $config->param( 'type',    'brand' );
     $config->param( 'version', $INIT_VERSION );
-    $config->param( 'release', '0' );
 
     my $self = bless {}, $class;
 
Not sure if we should use the supplied patch to fix this or relocate the book_template directory to the brand, or give the book template dir it's own conf entry.

Comment 5 Jeff Fearn 🐞 2013-02-08 03:22:09 UTC
Fix committed to master for 3.1.2 hotfix.

Used supplied patch, and fixed translation bug.

To ssh://git.fedorahosted.org/git/publican.git
   660a3ae..1e5436a  master -> master

Comment 6 Jeff Fearn 🐞 2013-03-05 02:16:32 UTC
This bug has been fixed in Publican 3.1.3