Bug 511207

Summary: Tests failures with libxml2 2.15
Product: [Applications] tellico Reporter: Pino Toscano <pino>
Component: generalAssignee: Robby Stephenson <robby>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 4.1.4   
Target Milestone: ---   
Platform: Other   
OS: All   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Pino Toscano 2025-10-27 12:00:48 UTC
There are few test failures when running the tests after building tellico (both 4.1.3 and the newly released 4.1.4, and most likely older versions too) using libxml2 2.15.

=============

The first ones are in TellicoReadTest:

46: FAIL!  : TellicoReadTest::testXmlName(is-€:) Compared values are not the same
46:    Actual   (Tellico::XML::elementName(input)): "is-\u20AC"
46:    Expected (modified)                        : "is-"
46:    Loc: [./src/tests/tellicoreadtest.cpp(582)]
46: QDEBUG : TellicoReadTest::testRecoverXmlName(<is-€:>) tellico: Bad name is "is-€:" ; Good name is "is-€"
46: FAIL!  : TellicoReadTest::testRecoverXmlName(<is-€:>) Compared values are not the same
46:    Actual   (Tellico::XML::recoverFromBadXMLName(input)): "<fields><field name=\"is-\xE2\x82\xAC\"/></fields><is-\xE2\x82\xAC>x</is-\xE2\x82\xAC>"
46:    Expected (modified)                                  : "<fields><field name=\"is-\"/></fields><is->x</is->"
46:    Loc: [./src/tests/tellicoreadtest.cpp(606)]

I see various changes in libxml2 around the code for xmlValidateNCName(), which gets the results of internal refactorings to use more shared code. Since there was already an unicode character marked as allowed in one of the inputs of TellicoReadTest::testXmlName(), I think the EURO sign should be allowed as well.
I created https://invent.kde.org/office/tellico/-/merge_requests/25 to tweak the tests according to the libxml2 version.

=============

The second ones are in HtmlExporterTest:

40: QDEBUG : HtmlExporterTest::testTemplatesTidy(Group_Statistics.xsl:ted) "line 4 column 1 - Error: <meta> attribute \"charset\" not allowed for HTML 4.01 Strict"
40: QDEBUG : HtmlExporterTest::testTemplatesTidy(Group_Statistics.xsl:ted) "line 6 column 1 - Error: <script> attribute \"language\" not allowed for HTML 4.01 Strict"
40: QDEBUG : HtmlExporterTest::testTemplatesTidy(Group_Statistics.xsl:ted) "line 6 column 83 - Error: <script> attribute \"language\" not allowed for HTML 4.01 Strict"
40: QDEBUG : HtmlExporterTest::testTemplatesTidy(Group_Statistics.xsl:ted) "line 6 column 166 - Error: <script> attribute \"language\" not allowed for HTML 4.01 Strict"
40: QDEBUG : HtmlExporterTest::testTemplatesTidy(Group_Statistics.xsl:ted) "line 6 column 253 - Error: <script> attribute \"language\" not allowed for HTML 4.01 Strict"
40: QDEBUG : HtmlExporterTest::testTemplatesTidy(Group_Statistics.xsl:ted) "This document has errors that must be fixed before"
40: QDEBUG : HtmlExporterTest::testTemplatesTidy(Group_Statistics.xsl:ted) "using HTML Tidy to generate a tidied up version."
40: FAIL!  : HtmlExporterTest::testTemplatesTidy(Group_Statistics.xsl:ted) 'tidyProc.exitCode() < 2' returned FALSE. ()
40:    Loc: [./src/tests/htmlexportertest.cpp(283)]
40: QDEBUG : HtmlExporterTest::testTemplatesTidy(Group_Statistics.xsl:moody) "line 4 column 1 - Error: <meta> attribute \"charset\" not allowed for HTML 4.01 Strict"
40: QDEBUG : HtmlExporterTest::testTemplatesTidy(Group_Statistics.xsl:moody) "line 6 column 1 - Error: <script> attribute \"language\" not allowed for HTML 4.01 Strict"
40: QDEBUG : HtmlExporterTest::testTemplatesTidy(Group_Statistics.xsl:moody) "line 6 column 83 - Error: <script> attribute \"language\" not allowed for HTML 4.01 Strict"
40: QDEBUG : HtmlExporterTest::testTemplatesTidy(Group_Statistics.xsl:moody) "line 6 column 166 - Error: <script> attribute \"language\" not allowed for HTML 4.01 Strict"
40: QDEBUG : HtmlExporterTest::testTemplatesTidy(Group_Statistics.xsl:moody) "line 6 column 253 - Error: <script> attribute \"language\" not allowed for HTML 4.01 Strict"
40: QDEBUG : HtmlExporterTest::testTemplatesTidy(Group_Statistics.xsl:moody) "This document has errors that must be fixed before"
40: QDEBUG : HtmlExporterTest::testTemplatesTidy(Group_Statistics.xsl:moody) "using HTML Tidy to generate a tidied up version."
40: FAIL!  : HtmlExporterTest::testTemplatesTidy(Group_Statistics.xsl:moody) 'tidyProc.exitCode() < 2' returned FALSE. ()
40:    Loc: [./src/tests/htmlexportertest.cpp(283)]

There were lots of validation changes related to the HTML parser between libxml2 2.14 and 2.15. I'm not sure what triggers exactly or whether it might be a problem in tidy itself. At a first noob look, it seems the generated/exported HTML might not be actually valid.
Would you please check that?
Comment 1 Robby Stephenson 2025-11-02 18:49:30 UTC
Git commit 6f765a81c2007cdd2deecb8293be8cb185e1a5b2 by Robby Stephenson.
Committed on 02/11/2025 at 18:49.
Pushed by rstephenson into branch '4.1'.

Remove the Group Statistics report and associated jquery

This report was never installed, by default, and is being moved
to the tellico-addons repo.

D  +0    -248  xslt/report-templates/Group_Statistics.xsl
D  +0    -2395 xslt/report-templates/jquery.flot.js
D  +0    -834  xslt/report-templates/jquery.flot.pie.js
D  +0    -154  xslt/report-templates/jquery.min.js

https://invent.kde.org/office/tellico/-/commit/6f765a81c2007cdd2deecb8293be8cb185e1a5b2
Comment 2 Robby Stephenson 2025-11-09 19:06:33 UTC
Git commit 8d009ae8dd6e072a4eca5e050577dbfd79a2d0f5 by Robby Stephenson.
Committed on 09/11/2025 at 19:04.
Pushed by rstephenson into branch 'master'.

Remove the Group Statistics report and associated jquery

This report was never installed, by default, and is being moved
to the tellico-addons repo.

D  +0    -248  xslt/report-templates/Group_Statistics.xsl
D  +0    -2395 xslt/report-templates/jquery.flot.js
D  +0    -834  xslt/report-templates/jquery.flot.pie.js
D  +0    -154  xslt/report-templates/jquery.min.js

https://invent.kde.org/office/tellico/-/commit/8d009ae8dd6e072a4eca5e050577dbfd79a2d0f5