Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Plone 5 compatibilty #78

Closed
wants to merge 40 commits into from
Closed

[WIP] Plone 5 compatibilty #78

wants to merge 40 commits into from

Conversation

tomgross
Copy link
Member

@tomgross tomgross commented Sep 7, 2015

Another attempt to make c.solr compatible with Plone 5. Some tests are still failing but I think this is the best what we have at the moment. Any takers to help fixing the tests in Plone 5?

@karalics @do3cc Are you good to delete the plone5 branch? All the relevant parts have been moved and it is kinde of messed up.

@karalics
Copy link
Member

karalics commented Sep 7, 2015

It's OK for me. (deleting plone5 branch )

@tisto
Copy link
Member

tisto commented Feb 15, 2016

@tomgross I would love to see this getting merged. Do you see any chance to rebase? If you don't have time to work on this, maybe someone else can take over. We could also think about organizing a chipin to fund this...

Conflicts:
	src/collective/solr/testing.py
@tomgross
Copy link
Member Author

Hi @tisto this is almost done and works for our Plone 5 installation. The biggest issue ar the test failures resulting from the move of the configuration to plone.app.registry. Any help is appreciated here.

@tisto
Copy link
Member

tisto commented Feb 29, 2016

@tomgross that's good to hear! I briefly looked into this and it seems that the connection settings that are stored as unicode lead to problems with Solr in the test setup. I tried to add a few encode/decode statements but that did not help so far. Strange that this does not seem to happen in real life though.

@tisto
Copy link
Member

tisto commented Mar 30, 2016

@tomgross I would like to put some effort into fixing this. Is it ok if I work on your branch or do you prefer if I create my own branch?

@tomgross
Copy link
Member Author

Hi @tisto It is perfectly ok to work on my branch 👍


logger = getLogger('collective.solr.manager')
marker = object()


class BaseSolrConnectionConfig(object):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomgross why did you remove the SolrConnectionConfig? We need this to support multiple Plone instances in one Zope.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tisto Configuration moved to the registry. There is no need for a separate way to config solr and the registry is relative to a Plone instance which should allow multiple Plone instances in on Zope. Did I miss something?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomgross in theory yes, in practice no. Things are way more complex than that. By removing the ISolrConnectionConfig you also removed the IZCMLSolrConnection config lookup. This removal requires a considerable refactoring both in the code and in the test setup.

I tried to mock the registry lookup for the unit tests, but this did not work out... :(

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this complexity? I mean it is just a connection between a CMS and an index based on an api (collective.indexing). It shouldn't be that hard. PloneIntranet moved away from collective.solr because of this complexity.

gforcada and others added 4 commits April 6, 2016 05:37
``plone.recipe.zope2instance.ctl`` and ``zopectl.command`` provide totally different arguments to the entry point methods.
…is always properly loaded in the test setup.
@tisto
Copy link
Member

tisto commented Apr 11, 2016

@tomgross @do3cc I further investigated the current test failures in this branch. There are two kind of failures:

  1. Test isolation issues (most likely from the plone.app.testing refactoring):

There are a lot of test isolation issues here. I started to just comment out tests that bleed into other tests in order to find the real test failures. I'm down to two test failures. Though, even after fixing those, the isolation issues will remain. Some of them might have been triggered by the plone registry refactoring but I think a fair amount have nothing to do with this pr actually. Maybe we should start cleaning up the master branch before moving to this pr...

  1. Test failures because unit tests can not look up the registry.

This can be solved by mocking the registry lookup. I did some tests that look promising but I haven't found the right level of mocking yet. This is doable though.

The good thing so far is that expect one problem with the "active" setting, I did not find a problem in "real life".

cc @goschtl @loechel

@do3cc
Copy link
Member

do3cc commented Apr 11, 2016

What do you mean with plone.app.testing refactoring? The changes in plone.testing? They may fail now while they weren't failing earlier, but this is only, because test isolation was broken silently before.

@tisto
Copy link
Member

tisto commented Jun 7, 2016

Superseded by: #126

@tisto tisto closed this Jun 7, 2016
@tomgross tomgross deleted the plone5-try2 branch September 18, 2016 17:56
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.

None yet

5 participants