- 12 Jul, 2022 7 commits
-
-
Jérome Perrin authored
Zope4 uses urlparse + urlunparse to encode the URL, which has a side effect of removing the empty fragment from the URL. Using a lower level API to set the status code and the Location header we achieve the same result.
-
Jérome Perrin authored
-
Jérome Perrin authored
-
Jérome Perrin authored
On Zope2, there was support for starting a ZServer (in Testing.ZopeTestCase.utils.startZServer) and there was another makerequest (in Testing.ZopeTestCase.utils.makerequest) which had knowledge of this ZServer address. We are using our own implementation of startZServer, which also knows how to start a WSGI server, but we we were interacting with Testing.ZopeTestCase.utils so that its makerequest knows about our web server. On Zope4 there is no utility to start an http server from the tests and the makerequest is also gone. This revisits the web server from test interaction with makerequest: - no longer use PortalTestCase._app which creates an app with a request to http://nohost, but implement our own _app which creates a request to our web server - store our server address as class attributes on ProcessingNodeTestCase instead of patching pseudo constants in utils (these pseudo constants no longer exist) - in the case of ERP5TypeLiveTestCase, also rewrap the site to use a request to our web server (which was done on Zope2 by using Testing.ZopeTestCase.utils.makerequest and not Testing.makerequest.makerequest directly)
-
Jérome Perrin authored
This is supposed to fix "Should not load state for ${oid of a skin} when the connection is closed" sometimes happening with live tests (especially when the test self.publish and the developer access the site while the test is suspended on a debugger breakpoint). The object accessed after the connection is closed was a skin (python script, sometimes page template or form) that was cached in SKINDATA. The mechanism to prune entries from the cache uses REQUEST.hold API which expects that REQUEST.close is called on request, but because requests were not closed at the end of the request, it happened that the cache was reused from another connection. This change to close the requests, like ERP5TypeTestCase is doing in tearDown (the actual close is done by Testing.ZopeTestCase.connections). By closing requests at the end of tests, we also have to change so that at the beginning of the test we initialize the request, by using the same setSite and setupCurrentSkin that are done in ERP5TypeTestCase.
-
Jérome Perrin authored
-
Jérome Perrin authored
This reverts commit 3db20ae6 and commit 948d8b57. This commit and the fixup were not good, reverting to make a proper commit
-
- 07 Jul, 2022 2 commits
-
-
Valentin Benozillo authored
-
Valentin Benozillo authored
-
- 04 Jul, 2022 1 commit
-
-
Jérome Perrin authored
_Z2HOST / _Z2PORT no longer exist in Zope4, something was added in component/egg-patch/Zope/0001-OFS-XMLExportImport.patch in SlapOS software release, but we never had a strong need to patch there, we were doing this so that Testing.ZopeTestCase.utils.makerequest creates a REQUEST to this host:port, but now that Zope's startZServer no longer, the REQUEST created by Testing.ZopeTestCase.base.app is always to nohost:80, so we need to rewrap the app in request to our host:port.
-
- 02 Jul, 2022 2 commits
-
-
Jérome Perrin authored
Update to https://github.com/plone/Products.PortalTransforms/blob/3.2.0/Products/PortalTransforms/transforms/rest.py because Zope4 no longer ship with a reStructuredText module and recommend using docutils directly instead, which is what upstream did. ( in zope4py2 branch this was working because slapos patch component/egg-patch/Zope/0001-OFS-XMLExportImport.patch used to bring back reStructuredText but we don't seem to need it )
-
Jérome Perrin authored
_Z2HOST / _Z2PORT no longer exist in Zope4, something was added in component/egg-patch/Zope/0001-OFS-XMLExportImport.patch in SlapOS software release, but we never had a strong need to patch there, we were doing this (I guess) so that Testing.ZopeTestCase.utils.startZServer knows that a server is already running and refuse to start another one, but now that Zope's startZServer no longer exist, a local variable is just fine.
-
- 01 Jul, 2022 2 commits
-
-
Jérome Perrin authored
-
Romain Courteaud authored
-
- 27 Jun, 2022 3 commits
-
-
Jérome Perrin authored
-
Xiaowu Zhang authored
-
Jérome Perrin authored
-
- 24 Jun, 2022 1 commit
-
-
Xiaowu Zhang authored
-
- 23 Jun, 2022 2 commits
-
-
Xiaowu Zhang authored
-
Yusei Tahara authored
Use correct portal type.
-
- 22 Jun, 2022 3 commits
-
-
Kazuhiko Shiozaki authored
-
Kazuhiko Shiozaki authored
-
Kazuhiko Shiozaki authored
-
- 21 Jun, 2022 4 commits
-
-
Xiaowu Zhang authored
-
Xiaowu Zhang authored
-
Jérome Perrin authored
- Display the editor in ERP5 language, not browser language - Use PDF viewer for Drawing preview - Supports password protected PDFs - Others small changes See merge request nexedi/erp5!1639
-
Jérome Perrin authored
and several small fixes or changes to make this easier See merge request nexedi/erp5!1642
-
- 20 Jun, 2022 2 commits
-
-
Jérome Perrin authored
-
Jérome Perrin authored
This was a workaround for ChromeOS, but we realized it was not really good. Disable it for the same reasons as nexedi/slapos!1196 : - not everybody use ChromeOS - this breaks the ctrl+click shortcut to go to definition/follow link - it makes ERP5 monaco editor behaves differently from others monaco editor - ChromeOS users can use chrome://flags/#use-search-click-for-right-click
-
- 15 Jun, 2022 10 commits
-
-
Levin Zimmermann authored
When cleaning up Wendelin from restricted python pandas code (see https://lab.nexedi.com/levin.zimmermann/wendelin/tree/remove-redundant-pandas), it turned out that there was one line still missing in erp5. This missing line caused a failed test in wendelin functional tests: https://erp5js.nexedi.net/#/test_result_module/20220614-1B46817BD/6 Readding the line fixed the test.
-
Jérome Perrin authored
create_server returns either a BaseWSGIServer or a MultiSocketServer, but add_task only exists in BaseWSGIServer - and the implementation is simply [1]: def add_task(self, task): self.task_dispatcher.add_task(task) by using self.task_dispatcher.add_task directly, we are compatible with both cases. This is relevant when running timerserver with runUnitTest, where we create multiple sockets, one for http and one for web-dav. 1: https://github.com/Pylons/waitress/blob/v1.4.4/src/waitress/server.py#L290-L291
-
Jérome Perrin authored
The default TestCase.__call__ collects errors in a test result that was never retrieved, so errors were silently ignored. By using TestCase.debug , we let errors propagate. --- Minimal reproduction is running directly (ie. not with python -m unittest) a script like this: import unittest class T(unittest.TestCase): def method(self): print('ah ?') boom print('oh') t = T("method") t() # no error t.debug() # NameError: name 'boom' is not defined
-
Jérome Perrin authored
This helps debugging concurrency problems
-
Jérome Perrin authored
-
Jérome Perrin authored
This allows running tests using a timer server loop, that will invoke process timer on all subscribers. The need for this is to test a custom tool using timer server.
-
Jérome Perrin authored
It was enough for 2 nodes, but with 4 nodes I sometimes saw errors.
-
Jérome Perrin authored
This was a deprecated method that no longer exists since ZEO 4 https://github.com/zopefoundation/ZEO/commit/5423f110ddc1034ea0954495957894c60f6da78c
-
Jérome Perrin authored
_setUpDummyMailHost is also used to prevent accidentally sending "real" emails, so we also like to have it enabled for other nodes.
-
- 14 Jun, 2022 1 commit
-
-
Roque authored
-