Skip to content

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.

@jensens jensens marked this pull request as ready for review June 23, 2025 23:47
@jensens
Copy link
Member Author

jensens commented Jun 23, 2025

needs a merge of main - and look at the conflicts, then its ready for merge

@ale-rt
Copy link
Member

ale-rt commented Jun 24, 2025

I was trying this branch on a buildout and I get:

Develop: '.../oira/src/pas.plugins.ldap'
Failed to run command:
'.../bin/python3', '/tmp/tmp8lyz944w', '-q', 'develop', '-N', '-d', '/home/ale/Code/plone/projects/quoira/oira/develop-eggs/tmpsgh6xx60build'
Error output follows:
Traceback (most recent call last):
  File "/tmp/tmp8lyz944w", line 20, in <module>
    with open('.../src/pas.plugins.ldap/setup.py') as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '.../src/pas.plugins.ldap/setup.py'

@ale-rt
Copy link
Member

ale-rt commented Jun 24, 2025

needs a merge of main - and look at the conflicts, then its ready for merge

This PR wants to merge main in to this branch:

https://github.com/collective/pas.plugins.ldap/pull/136/files

BTW I would consider rebasing.

@jensens
Copy link
Member Author

jensens commented Jun 25, 2025

I was trying this branch on a buildout and I get:

Well. I have no idea how buildout works with modern project layouts with pyproject.toml only. AFAIK it is possible, but dont ask me details.

@ale-rt ale-rt mentioned this pull request Jun 26, 2025
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.

5 participants