Fix tests for not queries in Products.ZCatalog 7.2.0+#181
Conversation
See for example this [failure on Jenkins](https://jenkins.plone.org/job/pull-request-6.2-3.13/426/testReport/junit/plone.app.querystring.tests.testQueryBuilder/TestQuerybuilder/testMakeQueryWithMultipleSubjectNot/). The test created two content items with Subjects, and querying for all items without a specific Subject. This used to return 1 item. But now it returns 2, because the Plone Site object is also returned, which has no Subject set. This object used to be ignored in the catalog. See zopefoundation/Products.ZCatalog#148 What is a bit strange, is that the 'not' query does not return any results when I run it at the beginning of this test, so before any item with this Subject has been set. That might be a problem in ZCatalog still.
|
@wesleybl thanks for creating this Pull Request and helping to improve Plone! TL;DR: Finish pushing changes, pass all other checks, then paste a comment: To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically. Happy hacking! |
|
@mauritsvanrees @davisagli This version is also used in Plone 6.0. Can we update |
|
The GitHub Action tests are failing. Should we do something to the tests so that it pass on both versions of |
@wesleybl I would rather not update Plone 6.0 versions at this point. How about: change the test to test that testpage is NOT in the results, instead of testing for what IS there. Then it should pass with both versions of ZCatalog |
|
@jenkins-plone-org please run jobs |
@davisagli done. |
|
Ops! There's still another test to fix. |
The tests testMakeQueryWithSubjectNot and testMakeQueryWithMultipleSubjectNot previously asserted exact result URLs. Products.ZCatalog >= 7.2.0 may include the Plone site in results; update the test to only assert that the page with subject Lorem (self.testpage) is not present in the results to keep compatibility across ZCatalog versions.
55a5485 to
e82d5a9
Compare
@davisagli fixed. |
|
@jenkins-plone-org please run jobs |
|
The |
|
The failures on 6.0 jenkins seem to be unrelated (failures on all robot tests because new browsers need to be installed) I think this is safe to merge. |
Backport of #171 to
plone.app.querystring2.x.See: plone/buildout.coredev#1073