plone / plone.app.querystring

Provides an queryparser, querybuilder and extra helper tools, to parse stored queries to actual results, used in new style Plone collections
https://pypi.org/project/plone.app.querystring/
2 stars 26 forks source link

Config with default template #121

Closed gforcada closed 1 year ago

gforcada commented 1 year ago

@ale-rt some tests fail to run because zpretty reformatted a few files and added a utf-8 encoding declaration and lxml refuses to parse them as text, but suggests that they should be send to lxml as bytes rather.

Should we adapt the tests to parse the files as bytes, or rather should zpretty not add those utf-8 encoding declarations? 🤔

Error in test test_get_vocabularies (plone.app.querystring.tests.testRegistryReader.TestRegistryReader.test_get_vocabularies)
Traceback (most recent call last):
  File "/usr/lib64/python3.11/unittest/case.py", line 57, in testPartExecutor
    yield
  File "/usr/lib64/python3.11/unittest/case.py", line 623, in run
    self._callTestMethod(testMethod)
  File "/usr/lib64/python3.11/unittest/case.py", line 579, in _callTestMethod
    if method() is not None:
  File "plone.app.querystring/plone/app/querystring/tests/testRegistryReader.py", line 73, in test_get_vocabularies
    registry = self.createRegistry(td.test_vocabulary_xml)
  File "plone.app.querystring/plone/app/querystring/tests/testRegistryReader.py", line 47, in createRegistry
    importer.importDocument(xml)
  File "plone.app.querystring/.tox/test/lib/python3.11/site-packages/plone/app/registry/exportimport/handler.py", line 109, in importDocument
    tree = etree.fromstring(document)
  File "src/lxml/etree.pyx", line 3257, in lxml.etree.fromstring
  File "src/lxml/parser.pxi", line 1911, in lxml.etree._parseMemoryDocument
ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.

🍀

mister-roboto commented 1 year ago

@gforcada 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!

mauritsvanrees commented 1 year ago

I am running PR tests for these three together:

mauritsvanrees commented 1 year ago

Jenkins passes, but the gh-actions tests fail, also locally:

Failure in test test__navigationPath (plone.app.querystring.tests.testQueryParser.TestQueryGenerators)
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.10/3.10.10_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/usr/local/Cellar/python@3.10/3.10.10_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/case.py", line 591, in run
    self._callTestMethod(testMethod)
  File "/usr/local/Cellar/python@3.10/3.10.10_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/case.py", line 549, in _callTestMethod
    method()
  File "/Users/maurits/community/plone-coredev/6.0/src/plone.app.querystring/plone/app/querystring/tests/testQueryParser.py", line 535, in test__navigationPath
    self.assertEqual(parsed, expected)
  File "/usr/local/Cellar/python@3.10/3.10.10_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/case.py", line 845, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/local/Cellar/python@3.10/3.10.10_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/case.py", line 1144, in assertDictEqual
    self.fail(self._formatMessage(msg, standardMsg))
  File "/usr/local/Cellar/python@3.10/3.10.10_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/case.py", line 675, in fail
    raise self.failureException(msg)
AssertionError: {'path': {'query': ['//bar/']}} != {'path': {'query': ['/site/foo/bar/']}}
- {'path': {'query': ['//bar/']}}
+ {'path': {'query': ['/site/foo/bar/']}}
?                       ++++++++
mauritsvanrees commented 1 year ago

Ah, right, we need a new release of plone.app.layout in 6.0-dev. I will see to that.