From e109e09ae4e04a6f96afbaed834aa06f0797741e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 12 May 2026 09:46:54 +0200 Subject: [PATCH] Bug 42581: Exclude plugins' routes from xt/api.t MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If some plugins are installed and inject REST API routes, xt/api.t may fail. Test plan: You can install the Jump plugin (https://gitlab.com/joubu/koha-plugin-jump) and run xt/api.t It will fail: ``` get /contrib/jump/parse -> uses tag 'parse' not present in top level list get /contrib/jump/search -> uses tag 'search' not present in top level list get /contrib/jump/search -> uses tag 'objects' not present in top level list get /contrib/jump/static/static_files/commandPalette.js -> uses tag 'Jump' not present in top level list get /contrib/jump/static/static_files/jump.css -> uses tag 'Jump' not present in top level list [...] ``` Apply this patch and run `prove xt/api.t` again => It should pass Signed-off-by: Tomás Cohen Arazi Signed-off-by: Lucas Gass --- xt/api.t | 1 + 1 file changed, 1 insertion(+) diff --git a/xt/api.t b/xt/api.t index e466d9820d..69113c587b 100755 --- a/xt/api.t +++ b/xt/api.t @@ -33,6 +33,7 @@ my $t = Test::Mojo->new('Koha::REST::V1'); my $spec = $t->get_ok( '/api/v1/', 'Correctly fetched the spec' )->tx->res->json; my $paths = $spec->{paths}; +delete @{$paths}{ grep { m{^/contrib/} } keys %$paths }; # Skip routes injected by plugins my @missing_additionalProperties = ();