From c782cc718ade1f72cfdf4acfc62c973a801df759 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Mon, 14 Feb 2022 18:17:48 +0400 Subject: [PATCH] Workaround for Packages/build-deb CI failures Packages/build-deb CI flows failed on ubuntu-bionic and ubuntu-focal with the following mismatch in the ServerTest.suggestions unit-test: ``` [ RUN ] ServerTest.suggestions ../test/server.cpp:715: Failure Expected equality of these values: r->body Which is: ... removeEOLWhitespaceMarkers(expectedResponse) Which is: ... With diff: @@ -2,5 +2,5 @@ { \"value\" : \"Ray (movie)\", - \"label\" : \"Ray (<b>movie</b>...\", + \"label\" : \"Ray (<b>movie</b>)\", \"kind\" : \"path\" , \"path\" : \"A/Ray_(movie)\" Test context: url: /ROOT/suggest?content=zimfile&term=movie ``` For some reason (probably, a bug), the implementation of `Xapian::MSet::snippet()` on those platforms decided that a single closing parenthesis is more than is appropriate for inclusion in the snippet and replaced it with a (longer) ellipsis. Taking advantage of the necessity to work around that bug, the ServerTest.suggestions's functional coverage was enhanced - the problematic test point was replaced with a new one using a phrase instead of a single term. --- test/server.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/server.cpp b/test/server.cpp index 798d85f83..fe584ad83 100644 --- a/test/server.cpp +++ b/test/server.cpp @@ -664,17 +664,17 @@ R"EXPECTEDRESPONSE([ ] )EXPECTEDRESPONSE" }, - { /* url: */ "/ROOT/suggest?content=zimfile&term=movie", + { /* url: */ "/ROOT/suggest?content=zimfile&term=old%20sun", R"EXPECTEDRESPONSE([ { - "value" : "Ray (movie)", - "label" : "Ray (<b>movie</b>)", + "value" : "That Lucky Old Sun", + "label" : "That Lucky <b>Old</b> <b>Sun</b>", "kind" : "path" - , "path" : "A/Ray_(movie)" + , "path" : "A/That_Lucky_Old_Sun" }, { - "value" : "movie ", - "label" : "containing 'movie'...", + "value" : "old sun ", + "label" : "containing 'old sun'...", "kind" : "pattern" //EOLWHITESPACEMARKER }