Bug 1961070

Summary: perl-HTML-TreeBuilder-LibXML-0.26-18.fc35 FTBFS with libxml2-2.9.12: Failed test at t/05_empty.t line 18
Product: [Fedora] Fedora Reporter: Petr Pisar <ppisar>
Component: perl-HTML-TreeBuilder-LibXMLAssignee: Emmanuel Seyman <emmanuel>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: emmanuel, perl-devel
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://koschei.fedoraproject.org/package/perl-HTML-TreeBuilder-LibXML
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-06-14 19:23:34 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:
Bug Depends On:    
Bug Blocks: 1927309, 1964648, 1964653, 1964655, 1964657    

Description Petr Pisar 2021-05-17 07:30:51 UTC
perl-HTML-TreeBuilder-LibXML-0.26-18.fc35 fails to build in Fedora 35 because a test fails:

$ perl -Ilib t/05_empty.t
1..15
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
not ok 9
#   Failed test at t/05_empty.t line 18.
#                   ''
#     doesn't match '(?^:<html>)'
ok 10
ok 11
not ok 12
#   Failed test at t/05_empty.t line 18.
#                   ''
#     doesn't match '(?^:<html>)'
ok 13
ok 14
not ok 15
#   Failed test at t/05_empty.t line 18.
#                   ''
#     doesn't match '(?^:<html>)'
# Looks like you failed 3 tests of 15.

A difference between passing and failing build root is at <https://koschei.fedoraproject.org/build/10320715>. The failure is triggered by upgrading libxml2 from 2.9.10-12.fc35 to 2.9.12-1.fc35.

Comment 1 Emmanuel Seyman 2021-06-14 14:49:19 UTC
The test fails because HTML::TreeBuilder::LibXML returns an empty string while the test expects something containing <html>.

Looking at HTML::TreeBuilder::LibXML::Node::as_HTML(), it calls toStringHTML(), falls back on XML::LibXML::Node::toStringC14N() and finally on XML::LibXML::Node::toString(). In the case of an empty string, toStringHTML() cannot be called and, while XML::LibXML::Node::toString() returns '<html><body/></html>', XML::LibXML::Node::toStringC14N() returns an empty string without errors (so this ends up being used).

Hummm...

Comment 2 Emmanuel Seyman 2021-06-14 19:23:34 UTC
Built for rawhide:
https://koji.fedoraproject.org/koji/buildinfo?buildID=1771521