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

Plone 6 + py3 only, Makefile, GH Actions #113

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft

Plone 6 + py3 only, Makefile, GH Actions #113

wants to merge 22 commits into from

Conversation

jensens
Copy link
Member

@jensens jensens commented Feb 9, 2022

No description provided.

@jensens
Copy link
Member Author

jensens commented Jun 14, 2023

Test setup is broken: Testrunner and LDAP (slapd) not found.
@rnixx I think I need some hints how to configure it.

@mauritsvanrees
Copy link
Member

I have done a few minor fixes on the p6 branch.

Two problems remain, as @jensens already mentioned: no tests found and slapd not found.

When you run make test, it executes .mxmake/files/run-tests.sh pas.plugins.ldap. This boils down to venv/bin/zope-testrunner --module=pas.plugins.ldap, and this finds zero tests. So the test runner does not find any tests. The pas.plugins.ldap package is installed though, in editable mode.

What works for me instead: venv/bin/zope-testrunner --path src. I don't know where to fix this though: I don't know how the run-tests.sh file is created.

If we fix that, the second problem is that slapd is not found:

$ venv/bin/zope-testrunner --path src 
Running pas.plugins.ldap.testing.PASLDAPLayer tests:
  Set up node.ext.ldap.testing.SlapdConf /tmp/tmp59y4prjm
SlapdConf set up.
in 0.000 seconds.
  Set up node.ext.ldap.testing.Slapd 
Starting LDAP server: 
slapd -f /tmp/tmp59y4prjm/slapd.conf -h ldap://127.0.0.1:12345 -d 0
Traceback (most recent call last):
  File "/var/zope/kennis6-9350/checkouts/pas.plugins.ldap/venv/lib/python3.11/site-packages/zope/testrunner/runner.py", line 464, in run_layer
    setup_layer(options, layer, setup_layers)
  File "/var/zope/kennis6-9350/checkouts/pas.plugins.ldap/venv/lib/python3.11/site-packages/zope/testrunner/runner.py", line 829, in setup_layer
    setup_layer(options, base, setup_layers)
  File "/var/zope/kennis6-9350/checkouts/pas.plugins.ldap/venv/lib/python3.11/site-packages/zope/testrunner/runner.py", line 829, in setup_layer
    setup_layer(options, base, setup_layers)
  File "/var/zope/kennis6-9350/checkouts/pas.plugins.ldap/venv/lib/python3.11/site-packages/zope/testrunner/runner.py", line 829, in setup_layer
    setup_layer(options, base, setup_layers)
  File "/var/zope/kennis6-9350/checkouts/pas.plugins.ldap/venv/lib/python3.11/site-packages/zope/testrunner/runner.py", line 834, in setup_layer
    layer.setUp()
  File "/var/zope/kennis6-9350/checkouts/pas.plugins.ldap/sources/node.ext.ldap/src/node/ext/ldap/testing/__init__.py", line 172, in setUp
    self.slapd = subprocess.Popen(cmd)
  File "/usr/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1950, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'slapd'

I did run make install first, and this creates an slapd command in ./openldap/servers/slapd/. When I add this directory to the path and run the tests, slapd can start, but then we are missing ldapadd. This is in ./openldap/bin/. So I add this to the PATH as well, and... success!

$ venv/bin/zope-testrunner --path src
...
Total: 28 tests, 0 failures, 0 errors and 0 skipped in 1.948 seconds.

This is with Python 3.11 on Ubuntu 22.04.

@jensens @rnixx Does this give you enough hints to pick this up again?

@mauritsvanrees
Copy link
Member

In other news, the p6 branch seems to work fine in practice for one client that we are testing it for, and where previous versions run fine on Plone 4.3 and 5.2.

Using these versions next to an internal release of p6:

bda.cache = 1.3.0
five.globalrequest = 99.1
node = 1.2.1
node.ext.ldap = 1.2
node.ext.ugm = 1.1
odict = 1.9.0
passlib = 1.7.4
pyasn1 = 0.5.1
pyasn1-modules = 0.3.0
python-ldap = 3.4.4
python-memcached = 1.59
yafowil = 3.1.0
yafowil.bootstrap = 2.0.0a1
yafowil.plone = 5.0.0a1
yafowil.widget.array = 2.0a1
yafowil.widget.dict = 2.0a1
yafowil.yaml = 2.0

I don't think we are using groups from LDAP in this site. But authentication works, and search works.

Control panel could be a bit better: fieldsets are not shown in tabs, but simply everything below each other. But that is a minor point for me.

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.

2 participants