Closed pbauer closed 6 years ago
This change increased the number of running test in python 3 by +748 and added 310 failing tests (https://jenkins.plone.org/view/PLIPs/job/plip-py3/463). So in raw numbers that seems like a good idea.
I'm willing to fix all these tests (mosty replace obj.setFoo('bar')
with obj.foo = 'bar'
).
One alternative would be to provide a self.publish
method in in plone.app.testing. Another is to migrate all tests that use self.publish
to now use restrictedTraverse
or the testbrowser.
Opinions or other options?
Some more things:
I have started fixing the failing PloneTestCase tests in CMFPlone and it is going pretty good. I will commit some of the first changes to a separate branch today.
During fixing the tests I found a couple of issues with Dexterity. Some tests of features that work with AT do not work with DX because the features are different or missing. That is generally good because we want to fix these issues. But: even more work.
Most importantly:
Regarding your comments:
restrictedTraverse
rather than adding yet even more indirection with a self.publish
methodYou are doing a great job! If you need more hands, it might be a good idea to create a tracker ticket to give bite sized chunks of things to port, something that one could do in some free hours during an afternoon or weekend.
I myself tried to fix some failing tests the other day and was a bit let down as there was someone else already working on it as well and it was a bit confusing how thing should get merged and how to actually check that what you are doing is actually improving the situation.
These examples that you are giving now about "just" changing this or that to fix some tests, might be a good idea to have them as these tasks I was mentioning.
I just realized that this will break many tests in Archetypes, ATContentTypes and related packages since they now get DX as content. We should create a py2-only testlayer for these Tests exactly like the old PloneTestCase and have all test in AT-packages and ATCTSiteTestCase use that.
@pbauer we can create a layer on those packages to override the changes done here. I guess this is possible, right?
I'm not sure if that's possible without changing the imports of PloneTestCase for all tests. And if we need to do that it does not really matter if we overwrite the existing one or use a new one. Luckly many tests already use ATCTTypeTestCase and changing that is easy.
I can start working on that next week since I'm currently busy with client-work. So if you want to tackle that please go ahead 😄
For now this is just a crazy experiment. Porting all tests away from PloneTestCase seems way more work that migrating the layer and fixing the tests. Also we have no replacement for self.publish in the modern testlayers.