Bugzilla – Attachment 59287 Details for
Bug 17917
t/db_dependent/check_sysprefs.t fails on kohadev strangely
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17917: Fix path issue in t/db_dependent/check_sysprefs.t
Bug-17917-Fix-path-issue-in-tdbdependentchecksyspr.patch (text/plain), 2.74 KB, created by
Gracie
on 2017-01-19 21:33:23 UTC
(
hide
)
Description:
Bug 17917: Fix path issue in t/db_dependent/check_sysprefs.t
Filename:
MIME Type:
Creator:
Gracie
Created:
2017-01-19 21:33:23 UTC
Size:
2.74 KB
patch
obsolete
>From ea15b5826fbffdca2229185343ef20369a138a4d Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Thu, 19 Jan 2017 00:38:52 +0000 >Subject: [PATCH] Bug 17917: Fix path issue in t/db_dependent/check_sysprefs.t > >C4::Context->config('intranet') is returning different >values based on whether it is a full t/db_dependent test >or a specific check_sysprefs.t test run. > >Tests are only run in kohaclone, so it makes no sense to >reference config at all. Brought in rel2abs logic to build >a reasonable $root_dir. > >TEST PLAN >--------- >-- on a kohadevbox > >sudo apt-get update >sudo apt-get upgrade >-- need to make sure the koha-commonpackage is more current > >git checkout master >git pull >sudo koha-shell -c "prove t/db_dependent" kohadev >-- this should have a check_sysprefs.t failure >sudo koha-shell -c "prove t/db_dependent/check_sysprefs.t" kohadev >-- this should strangely pass > >git checkout -b bug_17917 origin/master >git bz apply 17917 >sudo koha-shell -c "prove t/db_dependent" kohadev >-- there will not be a check_sysprefs.t failure >sudo koha-shell -c "prove t/db_dependent/check_sysprefs.t" kohadev >-- this should pass > >-- run koha qa test tools > >Signed-off-by: Grace McKenzie <grace.mcky@gmail.com> > >https://bugs.koha-community.org/show_bug.cgi?id=16387 >Signed-off-by: Grace McKenzie <grace.mcky@gmail.com> >--- > t/db_dependent/check_sysprefs.t | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > >diff --git a/t/db_dependent/check_sysprefs.t b/t/db_dependent/check_sysprefs.t >index a53c575..38212b3 100755 >--- a/t/db_dependent/check_sysprefs.t >+++ b/t/db_dependent/check_sysprefs.t >@@ -17,9 +17,11 @@ > # with this program; if not, write to the Free Software Foundation, Inc., > # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > >-use strict; >-use warnings; >+use Modern::Perl; > >+use Carp; >+use File::Basename; >+use File::Spec; > use Getopt::Long; > use C4::Context; > >@@ -30,15 +32,16 @@ GetOptions( 'showsql' => \$showsql ); > > use Test::More qw(no_plan); > our $dbh = C4::Context->dbh; >-my $root_dir = C4::Context->config('intranetdir') . '/installer/data/mysql'; >+my $root_dir = File::Spec->rel2abs( dirname(__FILE__) . '/../../installer/data/mysql' ); > my $base_syspref_file = "sysprefs.sql"; > >-open( my $ref_fh, "<$root_dir/$base_syspref_file" ); >+open my $ref_fh, '<', "$root_dir/$base_syspref_file" or croak "Can't open '$root_dir/$base_syspref_file': $!"; > my $ref_syspref = get_syspref_from_file($ref_fh); > my @ref_sysprefs = sort { lc $a cmp lc $b } keys %$ref_syspref; >+my $num_sysprefs = scalar @ref_sysprefs; > if ( !$showsql ) { >- cmp_ok( $#ref_sysprefs, '>=', 0, >- "Found " . ( $#ref_sysprefs + 1 ) . " sysprefs" ); >+ cmp_ok( $num_sysprefs, '>=', 1, >+ "Found $num_sysprefs sysprefs" ); > } > > check_db($ref_syspref); >-- >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 17917
:
59026
|
59027
|
59028
|
59029
|
59030
|
59031
|
59039
|
59040
|
59041
|
59042
|
59044
|
59045
|
59046
|
59052
|
59062
|
59175
|
59206
|
59207
|
59274
|
59287
|
59299
|
59310
|
59311
|
59313
|
59319
|
59320
|
59321