This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 908956 - The test suite fails when publican is not installed
The test suite fails when publican is not installed
Status: CLOSED CURRENTRELEASE
Product: Publican
Classification: Community
Component: publican (Show other bugs)
3.1
Unspecified Unspecified
unspecified Severity unspecified
: 3.2
: ---
Assigned To: Jeff Fearn
tools-bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-07 16:30 EST by Raphaël Hertzog
Modified: 2013-07-04 00:49 EDT (History)
2 users (show)

See Also:
Fixed In Version: 3.1.3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-03-04 21:16:32 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Patch to work-around the testsuite failures (1.06 KB, patch)
2013-02-07 16:43 EST, Raphaël Hertzog
no flags Details | Diff

  None (edit)
Description Raphaël Hertzog 2013-02-07 16:30:05 EST
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 16:43:01 EST
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 16:49:12 EST
Forget the change about t/110.CreateBrand.t it's just wrong.
Comment 3 Raphaël Hertzog 2013-02-07 17:32:55 EST
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 18:13:05 EST
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-07 22:22:09 EST
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-04 21:16:32 EST
This bug has been fixed in Publican 3.1.3

Note You need to log in before you can comment on or make changes to this bug.