Bug 41273 - xt/perltidy.t could use the same parallel handling as other tests
Summary: xt/perltidy.t could use the same parallel handling as other tests
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Martin Renvoize (ashimema)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-19 16:51 UTC by Martin Renvoize (ashimema)
Modified: 2025-11-19 16:56 UTC (History)
0 users

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


Attachments
Bug 41273: Parallelize test execution for improved performance (2.69 KB, patch)
2025-11-19 16:56 UTC, Martin Renvoize (ashimema)
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 16:51:43 UTC
Some of our tests look for the number of CPU's in the environment they're running on and then split the tests to run in parallel.  We could do that for xt/perltidy.t too and save time when running those tests locally.
Comment 1 Martin Renvoize (ashimema) 2025-11-19 16:56:23 UTC
Created attachment 189714 [details] [review]
Bug 41273: Parallelize test execution for improved performance

This patch adds parallel processing to xt/perltidy.t using
Parallel::ForkManager, following the same pattern as xt/pl_valid.t
and xt/tt_tidy.t.

Changes:
- Uses Parallel::ForkManager to process files concurrently
- Auto-detects CPU count via Sys::CPU (respects KOHA_PROVE_CPUS env var)
- Preserves working directory context in forked child processes
- Maintains correct failure tracking in %results hash

Performance improvement: ~N× speedup on N-core systems
(e.g., 8× faster on 8-core, 16× faster on 16-core machines)

Test plan:
1. Clear incremental test cache (if needed):
   docker exec kohadev-koha bash -c 'rm -rf /tmp/koha-ci-results/perltidy*'
2. Run test:
   docker exec kohadev-koha bash -c 'KOHA_PROVE_CPUS=8 prove xt/perltidy.t'
3. Verify all 3138 tests pass
4. Verify test completes significantly faster than before