Test failures when building with libxml 2.9.12+dfsg-2

Bug #1942130 reported by Sergio Durigan Junior
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libxml-ruby
Fix Released
Unknown
ruby-libxml (Ubuntu)
Fix Released
High
Sergio Durigan Junior

Bug Description

ruby-libxml's tests are failing with the libxml2 2.9.12+dfsg-2 package.

Here is the autopkgtest log:

https://autopkgtest.ubuntu.com/results/autopkgtest-impish/impish/amd64/r/ruby-libxml/20210830_160919_826c1@/log.gz

  1) Failure:
TestParserContext#test_parse_error [/tmp/autopkgtest.HKmwPV/build.7Cu/src/test/test_parser_context.rb:188]:
Expected: 17
  Actual: 0

  2) Failure:
TestParser#test_error [/tmp/autopkgtest.HKmwPV/build.7Cu/src/test/test_parser.rb:274]:
Expected: 20
  Actual: 18

  3) Failure:
TestSaxParser#test_parse_error [/tmp/autopkgtest.HKmwPV/build.7Cu/src/test/test_sax_parser.rb:257]:
--- expected
+++ actual
@@ -1 +1 @@
-"error: Fatal error: EndTag: '</' not found at :2."
+"error: Fatal error: Premature end of data in tag Results line 1 at :2."

These are not the only failures, though. Once we fix them, others show up. This makes the package FTBFS, as well as causes autopkgtest failures.

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

This patch fixes all the test issues I was able to find while building ruby-libxml against libxml2 2.9.12.

There are a bunch of minor things that changed with this new libxml2 release and that needed to be adjusted in ruby-libxml's testsuite. I've made a list of them in the patch itself.

The first one is the fact that the num_chars parameter (from the Context object) has been deprecated and is now always zero. This comes from the following commit:

https://gitlab.gnome.org/GNOME/libxml2/-/commit/438e595a8cccbe48de3a0be2e0c291cfe97080b1

The second thing that needed adjustment were the "Fatal error" messages expected when there's a parsing error. These messages had been changed in libxml2 2.9.10, but were changed again (and reverted back) in this latest release.

The third thing is the error code expected when the XML contains a tag that hasn't been finished. The previous error code was LibXML::XML::Error::LTSLASH_REQUIRED, but now libxml2 gives us LibXML::XML::Error::TAG_NOT_FINISHED.

The fourth problem was related to error strings and codes being returned by libxml2. The new codes make more sense (for example, previously we were expecting libxml2 to say that the error was happening on column 20 of an 18-column string, but now the error column is rightfully set to 18).

I've also forwarded the patch upstream:

https://github.com/xml4r/libxml-ruby/pull/173

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

autopkgtest is now passing (with -proposed enabled):

973 autopkgtest [16:51:28]: @@@@@@@@@@@@@@@@@@@@ summary
974 gem2deb-test-runner PASS

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for your patch Sergio! Good work forwarding it upstream, we should get this patch in Debian as well. LGTM, +1.

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thanks for the review, Lucas.

Uploaded:

$ dput ruby-libxml_3.2.0-1ubuntu1_source.changes
Trying to upload package to ubuntu
Checking signature on .changes
gpg: /home/sergio/work/ruby-libxml/ruby-libxml_3.2.0-1ubuntu1_source.changes: Valid signature from 106DA1C8C3CBBF14
Checking signature on .dsc
gpg: /home/sergio/work/ruby-libxml/ruby-libxml_3.2.0-1ubuntu1.dsc: Valid signature from 106DA1C8C3CBBF14
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading ruby-libxml_3.2.0-1ubuntu1.dsc: done.
  Uploading ruby-libxml_3.2.0-1ubuntu1.debian.tar.xz: done.
  Uploading ruby-libxml_3.2.0-1ubuntu1_source.buildinfo: done.
  Uploading ruby-libxml_3.2.0-1ubuntu1_source.changes: done.
Successfully uploaded packages.

I will also upload it to the Debian package soon.

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ruby-libxml - 3.2.0-1ubuntu1

---------------
ruby-libxml (3.2.0-1ubuntu1) impish; urgency=medium

  * d/p/fix-tests-libxml2-2.9.12.patch: Fix testsuite problems caused by
    the recent update to libxml2 2.9.12. (LP: #1942130)

 -- Sergio Durigan Junior <email address hidden> Mon, 30 Aug 2021 15:37:01 -0400

Changed in ruby-libxml (Ubuntu):
status: In Progress → Fix Released
Changed in libxml-ruby:
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.