Bugzilla – Attachment 67484 Details for
Bug 18979
Speed up 'valid-templates.t' tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18979: Speed up 'valid-templates.t' tests
Bug-18979-Speed-up-valid-templatest-tests.patch (text/plain), 1.66 KB, created by
David Bourgault
on 2017-09-29 18:36:39 UTC
(
hide
)
Description:
Bug 18979: Speed up 'valid-templates.t' tests
Filename:
MIME Type:
Creator:
David Bourgault
Created:
2017-09-29 18:36:39 UTC
Size:
1.66 KB
patch
obsolete
>From 0887ed334bd6053b0eaa6205050ae5204d8cc5b5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 19 Jul 2017 20:29:26 -0300 >Subject: [PATCH] Bug 18979: Speed up 'valid-templates.t' tests > >Test plan: >Confirm than prove xt/author/valid-templates.t is quicker with this >patch. > >Before I got: >Files=1, Tests=840, 21 wallclock secs ( 0.18 usr 0.02 sys + 20.28 cusr >0.32 csys = 20.80 CPU) > >After: >Files=1, Tests=840, 17 wallclock secs ( 0.06 usr 0.01 sys + 21.56 cusr >0.48 csys = 22.11 CPU) >--- > xt/author/valid-templates.t | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > >diff --git a/xt/author/valid-templates.t b/xt/author/valid-templates.t >index 5502d55..c9c439a 100644 >--- a/xt/author/valid-templates.t >+++ b/xt/author/valid-templates.t >@@ -20,6 +20,10 @@ > use strict; > use warnings; > >+use threads; # used for parallel >+use Parallel::ForkManager; >+use Sys::CPU; >+ > =head1 NAME > > valid-templates.t >@@ -64,8 +68,18 @@ for my $theme ( grep { not /^\.|lib|js/ } readdir($dh) ) { > } > close $dh; > >+my $ncpu; >+if ( $ENV{KOHA_PROVE_CPUS} ) { >+ $ncpu = $ENV{KOHA_PROVE_CPUS} ; # set number of cpus to use >+} else { >+ $ncpu = Sys::CPU::cpu_count(); >+} >+ >+my $pm = new Parallel::ForkManager($ncpu); >+ > # Tests > foreach my $theme ( @themes ) { >+ $pm->start and next; # do the fork > print "Testing $theme->{'type'} $theme->{'theme'} templates\n"; > if ( $theme->{'theme'} eq 'bootstrap' ) { > run_template_test( >@@ -83,8 +97,11 @@ foreach my $theme ( @themes ) { > $theme->{'includes'}, > ); > } >+ $pm->finish; > } > >+$pm->wait_all_children; >+ > done_testing(); > > sub run_template_test { >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18979
:
65208
|
67484
|
69150
|
71552