feat: add live-test container for the directory adapter
A test stage in the Dockerfile and an opt-in compose profile run the live directory checks against the test OU inside the image, reading the LDAP_* values from .env. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N3t4WL7bd9bdHHNjEsxzqC
This commit is contained in:
@@ -51,10 +51,13 @@ uv run ruff check .
|
||||
|
||||
### Directory adapter against the test OU
|
||||
|
||||
`uv sync` builds `python-ldap`, which needs the OpenLDAP and SASL development libraries (the Docker image installs them). The automated tests use an in-memory fake and a stand-in for the `ldap` module, so they run anywhere. To check the real adapter against the test OU, run this on a Linux host with the libraries installed (never against the production OU):
|
||||
`uv sync` builds `python-ldap`, which needs the OpenLDAP and SASL development libraries (the Docker image installs them). The automated tests use an in-memory fake and a stand-in for the `ldap` module, so they run anywhere.
|
||||
|
||||
To check the real adapter against the test OU (never the production OU), run the opt-in test container on the Linux host. It reads the `LDAP_*` values and `CA_FILE_HOST` from `.env`; the test user's current password comes from your shell:
|
||||
|
||||
```sh
|
||||
PORTAL_LIVE_LDAP=1 LIVE_LDAP_SERVER=... LIVE_LDAP_USER_OU_DN=... LIVE_LDAP_BIND_DN=... LIVE_LDAP_BIND_PASSWORD=... LIVE_LDAP_CA_FILE=... LIVE_LDAP_PUBLISHER_GROUP_DN=... LIVE_LDAP_ADMIN_GROUP_DN=... LIVE_LDAP_TEST_PASSWORD=<current password of ptest-user1> uv run pytest portal/tests/test_directory_live.py -v
|
||||
LIVE_LDAP_TEST_PASSWORD=<current password of ptest-user1> \
|
||||
docker compose --profile test run --rm live-test
|
||||
```
|
||||
|
||||
It restores what it writes and does not change any password.
|
||||
|
||||
Reference in New Issue
Block a user