Refactor LDAP tests#37274
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors the LDAP integration tests to reduce reliance on an external LDAP server by splitting scenarios into subtests and using mocks where possible, while also adjusting a few related test/helpers and admin auth-source editing behavior.
Changes:
- Consolidates LDAP integration tests under
TestAuthLDAPand gates real-LDAP-server scenarios behindTEST_LDAP. - Refactors HTML test helper to accept an
io.Readerand improves unexpected-response logging to ignore hidden flash errors. - Removes
AuthenticationForm.IDand redirects auth-source edit POSTs using the persistedsource.IDinstead.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/integration/integration_test.go | Avoids logging hidden flash error messages when diagnosing unexpected responses. |
| tests/integration/html_helper.go | Generalizes NewHTMLParser to accept any io.Reader. |
| tests/integration/auth_ldap_test.go | Restructures LDAP tests into subtests; adds mock-based email sign-in test and adds edit-or-create auth source helper. |
| services/forms/auth_form.go | Removes unused AuthenticationForm.ID field. |
| routers/web/admin/auths.go | Redirects after updating an auth source using source.ID instead of form-bound ID. |
| modules/testlogger/testlogger.go | Renames internal stdout printf helper and updates call sites. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Added |
|
It doesn't make any known fix for the reported issue (btw: the issue can be closed by this, until the error happens again) Either:
|
|
Removed the references then. If the failure is not reliably reproducible, we can't be sure whether any fix is right. |
I don't see it's worth to keep the issue open. In recent years, it only happened once. And even if it would happen next time, the code / stacktrace have hugely changed, the issue won't provide any useful information. The issue should be closed. |
will close the issue and next time we have more for tracing |
|
yes close it, next time we have more context if it should ever fail again. |
* main: (25 commits) Add WebKit to e2e test matrix (go-gitea#37298) Don't add useless labels which will bother changelog generation (go-gitea#37267) Fix Repository transferring page (go-gitea#37277) Stabilize issue-project e2e test, increase timeout factor (go-gitea#37297) Fix Mermaid diagrams failing when node labels contain line breaks (go-gitea#37296) Add project column picker to issue and pull request sidebar (go-gitea#37037) Fix container auth for public instance (go-gitea#37290) Refactor frontend `tw-justify-between` layouts to `flex-left-right` (go-gitea#37291) Update Nix flake (go-gitea#37284) Workflow Artifact Info Hover (go-gitea#37100) [skip ci] Updated translations via Crowdin release notes for 1.26.0 (go-gitea#37282) Enhance GetActionWorkflow to support fallback references (go-gitea#37189) Refactor LDAP tests (go-gitea#37274) Remove `SubmitEvent` polyfill (go-gitea#37276) Upgrade go-git to v5.18.0 (go-gitea#37268) Avoid top-level await (go-gitea#37272) Frontend iframe renderer framework: 3D models, OpenAPI (go-gitea#37233) pull: Fix CODEOWNERS absolute path matching. (go-gitea#37244) Swift registry metadata: preserve more JSON fields and accept empty metadata (go-gitea#37254) ...

Not really fix #37263, just make things better, and easy to catch more clues if it would fail again.