Bug 41274 - Incremental test runs not properly skipping Schema files
Summary: Incremental test runs not properly skipping Schema files
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low blocker
Assignee: Jonathan Druart
QA Contact: Tomás Cohen Arazi (tcohen)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-19 17:09 UTC by Martin Renvoize (ashimema)
Modified: 2025-11-21 15:43 UTC (History)
2 users (show)

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


Attachments
Bug 41274: Koha::Devel::Files - Fix exception filtering in incremental mode (3.29 KB, patch)
2025-11-19 17:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41274: Remove range parameter from ls_perl_files (2.41 KB, patch)
2025-11-20 14:01 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 41274: Remove the exceptions from git range (2.20 KB, patch)
2025-11-20 14:02 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 41274: Remove exceptions from files listed in the result repo (1.11 KB, patch)
2025-11-20 14:02 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 41274: Remove range parameter from ls_perl_files (2.46 KB, patch)
2025-11-21 14:51 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 41274: Remove the exceptions from git range (2.25 KB, patch)
2025-11-21 14:51 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 41274: Remove exceptions from files listed in the result repo (1.16 KB, patch)
2025-11-21 14:51 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 41274: Remove range parameter from ls_perl_files (2.62 KB, patch)
2025-11-21 14:58 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 41274: Remove the exceptions from git range (2.41 KB, patch)
2025-11-21 14:58 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 41274: Remove exceptions from files listed in the result repo (1.32 KB, patch)
2025-11-21 14:58 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2025-11-19 17:09:55 UTC
The incremental test runs Koha::Devel::Files module is failing to skip the DBIx::Class generated Schema files
Comment 1 Martin Renvoize (ashimema) 2025-11-19 17:11:00 UTC
Created attachment 189716 [details] [review]
Bug 41274: Koha::Devel::Files - Fix exception filtering in incremental mode

This patch fixes two bugs in the file exception filtering logic that
caused generated files (like Koha/Schema/Result/*) to not be excluded
properly when running in incremental/CI mode.

Bug #1: Incorrect array assignment
Lines 173 and 204 were assigning an arrayref as a single element
instead of dereferencing it:
  my @exception_files = $exceptions->{...};  # Wrong: creates array with 1 element (arrayref)
  my @exception_files = @{ $exceptions->{...} };  # Correct: dereferences to array

Bug #2: Pattern matching not supported
array_minus() only performs exact string matches, so patterns like
"Koha/Schema/Result" would not match "Koha/Schema/Result/Aqbasket.pm".

The fix:
- Properly dereferences exception patterns array
- Replaces array_minus with grep + regex pattern matching
- Uses /^\Q$_\E/ to match file paths starting with exception patterns
- Removes now-unused Array::Utils dependency

This ensures consistent behavior between:
- Non-incremental mode: Uses git ls-files with :(exclude) patterns
- Incremental mode: Now uses equivalent pattern matching

Test plan:
1. Run tests locally (non-incremental): prove xt/perltidy.t
2. Verify Schema files are excluded
3. Run in CI (incremental mode) with Schema file changes
4. Verify Schema files are now correctly excluded (previously failing)
Comment 2 Jonathan Druart 2025-11-20 13:52:48 UTC
Related to https://gitlab.com/koha-community/koha-testing-docker/-/merge_requests/562

Without we cannot test locally.
Comment 3 Jonathan Druart 2025-11-20 14:01:48 UTC
Created attachment 189776 [details] [review]
Bug 41274: Remove range parameter from ls_perl_files

It's not used.
Comment 4 Jonathan Druart 2025-11-20 14:02:01 UTC
Created attachment 189777 [details] [review]
Bug 41274: Remove the exceptions from git range

When listing the files from a git range we want to remove the exception
files from that list
Comment 5 Jonathan Druart 2025-11-20 14:02:13 UTC
Created attachment 189778 [details] [review]
Bug 41274: Remove exceptions from files listed in the result repo

IF we have pushed some files that should have been excluded from the
tests but have been processed previously and failed, we should skip it
the next build anyway
Comment 6 Lucas Gass (lukeg) 2025-11-21 14:51:25 UTC
Created attachment 189854 [details] [review]
Bug 41274: Remove range parameter from ls_perl_files

It's not used.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 7 Lucas Gass (lukeg) 2025-11-21 14:51:28 UTC
Created attachment 189855 [details] [review]
Bug 41274: Remove the exceptions from git range

When listing the files from a git range we want to remove the exception
files from that list

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 8 Lucas Gass (lukeg) 2025-11-21 14:51:31 UTC
Created attachment 189856 [details] [review]
Bug 41274: Remove exceptions from files listed in the result repo

IF we have pushed some files that should have been excluded from the
tests but have been processed previously and failed, we should skip it
the next build anyway

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 9 Tomás Cohen Arazi (tcohen) 2025-11-21 14:58:38 UTC
Created attachment 189857 [details] [review]
Bug 41274: Remove range parameter from ls_perl_files

It's not used.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Comment 10 Tomás Cohen Arazi (tcohen) 2025-11-21 14:58:40 UTC
Created attachment 189858 [details] [review]
Bug 41274: Remove the exceptions from git range

When listing the files from a git range we want to remove the exception
files from that list

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Comment 11 Tomás Cohen Arazi (tcohen) 2025-11-21 14:58:42 UTC
Created attachment 189859 [details] [review]
Bug 41274: Remove exceptions from files listed in the result repo

IF we have pushed some files that should have been excluded from the
tests but have been processed previously and failed, we should skip it
the next build anyway

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Comment 12 Lucas Gass (lukeg) 2025-11-21 15:43:23 UTC
Nice work everyone!

Pushed to main for 25.11