[PATCH pve-storage v1 01/54] test: plugin tests: run tests with at most 4 jobs

Max R. Carrara
2026-04-22T11:13:27Z

Speed up tests by allowing up to 4 jobs to run in parallel.

Base the amount of jobs on the output of `nproc` for environments with
less than 4 processing units available.

Sort tests alphabetically as well, just to make things neater.

Signed-off-by: Max R. Carrara <m.carrara@proxmox.com>
---
src/test/run_plugin_tests.pl | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/test/run_plugin_tests.pl b/src/test/run_plugin_tests.pl
index 8bce9d3b..27c45b8c 100755
--- a/src/test/run_plugin_tests.pl
+++ b/src/test/run_plugin_tests.pl
@@ -8,14 +8,21 @@ $ENV{TZ} = 'UTC';

use TAP::Harness;

-my $harness = TAP::Harness->new({ verbosity => -1 });
+my $MAX_JOBS = 4;
+
+my $nproc = eval { int(`nproc`) } || $MAX_JOBS;
+
+my $jobs = $nproc > $MAX_JOBS ? $MAX_JOBS : $nproc;
+
+my $harness = TAP::Harness->new({ verbosity => -1, jobs => $jobs });
+
my $res = $harness->runtests(
"archive_info_test.pm",
- "parse_volname_test.pm",
- "list_volumes_test.pm",
- "path_to_volume_id_test.pm",
- "get_subdir_test.pm",
"filesystem_path_test.pm",
+ "get_subdir_test.pm",
+ "list_volumes_test.pm",
+ "parse_volname_test.pm",
+ "path_to_volume_id_test.pm",
"prune_backups_test.pm",
);

--
2.47.3