Bug 41616 - Warnings on authority_hooks.t
Summary: Warnings on authority_hooks.t
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Tomás Cohen Arazi (tcohen)
QA Contact: Testopia
URL:
Keywords:
Depends on: 36433 27173
Blocks:
  Show dependency treegraph
 
Reported: 2026-01-14 17:49 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2026-01-16 06:57 UTC (History)
1 user (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 41616: Silence warning in authority_hooks.t (2.19 KB, patch)
2026-01-14 18:02 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 41616: Silence warning in authority_hooks.t (2.22 KB, patch)
2026-01-16 06:57 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi (tcohen) 2026-01-14 17:49:03 UTC
Bug 36433 introduced a plugin hook for elasticsearch document generation, which makes the `authority_hooks.t` print some useless noise when ES is enabled in the context:

```shell
prove t/db_dependent/Koha/Plugins/t/db_dependent/Koha/Plugins/authority_hooks.t
t/db_dependent/Koha/Plugins/authority_hooks.t ................. 1/5 Plugin error (Test Plugin): Exception 'Koha::Exception' thrown 'elasticsearch_to_document ref record: MARC::Record - ref document: HASH'
Plugin error (Test Plugin): Exception 'Koha::Exception' thrown 'elasticsearch_to_document ref record: MARC::Record - ref document: HASH'
t/db_dependent/Koha/Plugins/authority_hooks.t ................. ok   
All tests successful.
Files=20, Tests=119, 24 wallclock secs ( 0.04 usr  0.02 sys + 17.89 cusr  2.33 csys = 20.28 CPU)
Result: PASS
```
Comment 1 Tomás Cohen Arazi (tcohen) 2026-01-14 18:02:56 UTC
Created attachment 191434 [details] [review]
Bug 41616: Silence warning in authority_hooks.t

This patch silences a useless warning that is printed when in ES context.

To test:
1. Launch a KTD instance with ES enabled:
   $ ktd --proxy --name 41616 --search-engine es8 up -d
   $ ktd --name 41616 --wait-ready 120
2. Run:
   $ ktd --name 41616 --shell
  k$ prove t/db_dependent/Koha/Plugins/authority_hooks.t
=> SUCCESS: Tests pass
=> FAIL: You see:

```shell
prove t/db_dependent/Koha/Plugins/authority_hooks.t
t/db_dependent/Koha/Plugins/authority_hooks.t ................. 1/5 Plugin error (Test Plugin): Exception 'Koha::Exception' thrown 'elasticsearch_to_document ref record: MARC::Record - ref document: HASH'
Plugin error (Test Plugin): Exception 'Koha::Exception' thrown 'elasticsearch_to_document ref record: MARC::Record - ref document: HASH'
t/db_dependent/Koha/Plugins/authority_hooks.t ................. ok
All tests successful.
Files=20, Tests=119, 24 wallclock secs ( 0.04 usr  0.02 sys + 17.89 cusr  2.33 csys = 20.28 CPU)
Result: PASS
```

3. Apply this patch
4. Repeat 2
=> SUCCESS: No tests changes, but no more weird warnings about elasticsearch
5. Sign off :-D
6. Cleanup:
   $ ktd --name 41616 down

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Comment 2 David Nind 2026-01-16 06:57:34 UTC
Created attachment 191550 [details] [review]
Bug 41616: Silence warning in authority_hooks.t

This patch silences a useless warning that is printed when in ES context.

To test:
1. Launch a KTD instance with ES enabled:
   $ ktd --proxy --name 41616 --search-engine es8 up -d
   $ ktd --name 41616 --wait-ready 120
2. Run:
   $ ktd --name 41616 --shell
  k$ prove t/db_dependent/Koha/Plugins/authority_hooks.t
=> SUCCESS: Tests pass
=> FAIL: You see:

```shell
prove t/db_dependent/Koha/Plugins/authority_hooks.t
t/db_dependent/Koha/Plugins/authority_hooks.t ................. 1/5 Plugin error (Test Plugin): Exception 'Koha::Exception' thrown 'elasticsearch_to_document ref record: MARC::Record - ref document: HASH'
Plugin error (Test Plugin): Exception 'Koha::Exception' thrown 'elasticsearch_to_document ref record: MARC::Record - ref document: HASH'
t/db_dependent/Koha/Plugins/authority_hooks.t ................. ok
All tests successful.
Files=20, Tests=119, 24 wallclock secs ( 0.04 usr  0.02 sys + 17.89 cusr  2.33 csys = 20.28 CPU)
Result: PASS
```

3. Apply this patch
4. Repeat 2
=> SUCCESS: No tests changes, but no more weird warnings about elasticsearch
5. Sign off :-D
6. Cleanup:
   $ ktd --name 41616 down

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>