Bugzilla – Attachment 69150 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: Swap threads for Test2::Suite
Bug-18979-Swap-threads-for-Test2Suite.patch (text/plain), 1.96 KB, created by
Mason James
on 2017-11-15 08:03:34 UTC
(
hide
)
Description:
Bug 18979: Swap threads for Test2::Suite
Filename:
MIME Type:
Creator:
Mason James
Created:
2017-11-15 08:03:34 UTC
Size:
1.96 KB
patch
obsolete
>From 3a2914ed6396268c04dc50b8b119525f96ef83ab Mon Sep 17 00:00:00 2001 >From: Mason James <mtj@kohaaloha.com> >Date: Wed, 15 Nov 2017 20:37:45 +1300 >Subject: [PATCH] Bug 18979: Swap threads for Test2::Suite >Content-Type: text/plain; charset="utf-8" > >this patch swaps threads for the Test2::Suite module > >to test... > >1/ apply patch > >2/ install Test2::Suite > $ sudo apt-get install libtest2-suite-perl , or... > > $ cpanm Test2::Suite > >3/ run test > > $ sudo koha-shell -c " export PERL5LIB=/home/mason/git/koha/master; prove -v xt/author/valid-templates.t" kmaster > ok 1 - Testing opac bootstrap templates { > ... > } > ok 2 - Testing staff prog templates { > ... > } > 1..2 > ok > All tests successful. > Result: PASS > >4. note test passes > Result: PASS >--- > xt/author/valid-templates.t | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > >diff --git a/xt/author/valid-templates.t b/xt/author/valid-templates.t >index c9c439a..aec00c8 100644 >--- a/xt/author/valid-templates.t >+++ b/xt/author/valid-templates.t >@@ -20,7 +20,9 @@ > use strict; > use warnings; > >-use threads; # used for parallel >+use Test2::IPC; # load early >+use Test2::Tools::Subtest qw/subtest_buffered/; >+ > use Parallel::ForkManager; > use Sys::CPU; > >@@ -34,7 +36,6 @@ This test checks all staff and OPAC templates and includes for syntax errors > > =cut > >- > use File::Find; > use File::Spec; > use Template; >@@ -80,7 +81,8 @@ 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"; >+ >+ subtest_buffered "Testing $theme->{'type'} $theme->{'theme'} templates\n" => sub { > if ( $theme->{'theme'} eq 'bootstrap' ) { > run_template_test( > $theme->{'modules'}, >@@ -97,6 +99,8 @@ foreach my $theme ( @themes ) { > $theme->{'includes'}, > ); > } >+ }; # ...end subtest >+ > $pm->finish; > } > >-- >2.1.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