Skip to content

Comments

Fix tests for not queries in Products.ZCatalog 7.2.0+#181

Merged
davisagli merged 2 commits into2.xfrom
Products.ZCatalog
Feb 24, 2026
Merged

Fix tests for not queries in Products.ZCatalog 7.2.0+#181
davisagli merged 2 commits into2.xfrom
Products.ZCatalog

Conversation

@wesleybl
Copy link
Member

Backport of #171 to plone.app.querystring 2.x.

See: plone/buildout.coredev#1073

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.
@mister-roboto
Copy link

@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:

@jenkins-plone-org please run jobs

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!

@wesleybl
Copy link
Member Author

@mauritsvanrees @davisagli This version is also used in Plone 6.0. Can we update Products.ZCatalog in Plone 6.0 as well? Or should we test the Plone version in the test?

@wesleybl
Copy link
Member Author

The GitHub Action tests are failing. Should we do something to the tests so that it pass on both versions of Products.ZCatalog (at least until a new version of Plone 6.1 is released)?

@davisagli
Copy link
Member

davisagli commented Feb 23, 2026

This version is also used in Plone 6.0. Can we update Products.ZCatalog in Plone 6.0 as well? Or should we test the Plone version in the test?

The GitHub Action tests are failing. Should we do something to the tests so that it pass on both versions of Products.ZCatalog (at least until a new version of Plone 6.1 is released)?

@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

@wesleybl
Copy link
Member Author

@jenkins-plone-org please run jobs

@wesleybl
Copy link
Member Author

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

@davisagli done.

@wesleybl
Copy link
Member Author

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.
@wesleybl
Copy link
Member Author

Ops! There's still another test to fix.

@davisagli fixed.

@wesleybl
Copy link
Member Author

@jenkins-plone-org please run jobs

@wesleybl
Copy link
Member Author

The plone.app.querystring tests passed with Products.ZCatalog 7.2.1: plone/buildout.coredev#1074

@davisagli
Copy link
Member

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.

@davisagli davisagli merged commit 0f1da2c into 2.x Feb 24, 2026
9 of 11 checks passed
@davisagli davisagli deleted the Products.ZCatalog branch February 24, 2026 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants