Bugzilla – Attachment 51840 Details for
Bug 16554
Web installer fails to load i18n sample data on MySQL 5.6+
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16554: DO NOT PUSH - test for all sample files
Bug-16554-DO-NOT-PUSH---test-for-all-sample-files.patch (text/plain), 2.70 KB, created by
Jonathan Druart
on 2016-05-26 14:18:37 UTC
(
hide
)
Description:
Bug 16554: DO NOT PUSH - test for all sample files
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-05-26 14:18:37 UTC
Size:
2.70 KB
patch
obsolete
>From feb01aacc37568e3591a41d17dea1316099eab8c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 26 May 2016 15:17:36 +0100 >Subject: [PATCH] Bug 16554: DO NOT PUSH - test for all sample files > >You will need to create a koha_test_installer DB before >--- > t/db_dependent/Test_installer.t | 60 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 60 insertions(+) > create mode 100644 t/db_dependent/Test_installer.t > >diff --git a/t/db_dependent/Test_installer.t b/t/db_dependent/Test_installer.t >new file mode 100644 >index 0000000..00f3a44 >--- /dev/null >+++ b/t/db_dependent/Test_installer.t >@@ -0,0 +1,60 @@ >+#!/usr/bin/perl >+ >+use Modern::Perl; >+ >+use Test::More; #tests => XXX; >+use File::Find; >+use File::Slurp; >+use List::MoreUtils qw( uniq ); >+use t::lib::Mocks; >+use C4::Installer; >+ >+my $db_name = 'koha_test_installer'; >+t::lib::Mocks::mock_config('database', $db_name); >+my $user = C4::Context->config('user'); >+my $pass = C4::Context->config('pass'); >+my $schema = Koha::Database->new->schema; >+ >+my $sample_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/'; >+my @global_files = ( >+ $sample_dir . 'audio_alerts.sql', >+ $sample_dir . 'sysprefs.sql', >+ $sample_dir . 'userflags.sql', >+ $sample_dir . 'userpermissions.sql', >+ $sample_dir . 'mandatory/subtag_registry.sql', >+); >+my $kohastructure = $sample_dir . '/kohastructure.sql'; >+ >+for my $lang ( qw ( de-DE en es-ES fr-CA fr-FR it-IT nb-NO pl-PL ru-RU uk-UA ) ) { >+ for my $marcflavour ( qw( marc21 unimarc ) ) { >+ say "loading kohastructure for $lang | not $marcflavour"; >+ recreate_db( $db_name ); >+ my $error = C4::Installer->new->load_sql( $kohastructure ); >+ my @sample_files = @global_files; >+ >+ find( sub { >+ push @sample_files, $File::Find::name if $_ =~ m|\.sql$|; >+ }, $sample_dir . '/' . $lang . '/' >+ ); >+ my $i = 1; >+ for my $sql_file ( @sample_files ) { >+ print $i++ . "/" . scalar @sample_files . "\r"; flush STDOUT; >+ next if $sql_file =~ $marcflavour; >+ #my $content = read_file( $sql_file ); >+ #my @tables = uniq map { $_ =~ s/insert\s*(ignore)?\s*into\s*`?(\w+)`?.*/$2/xmsi; $_ } grep {/insert\s*(ignore)?\s*into/xmsi} split '\n', $content; >+ my $error = C4::Installer->new->load_sql( $sql_file ); >+ warn $error if $error; >+ } >+ } >+} >+ >+sub recreate_db { >+ my $dbname = shift; >+ my $dbh = C4::Context->dbh; >+ eval { $dbh->do(qq|DROP DATABASE $dbname|) }; >+ >+ $dbh->do(qq|CREATE DATABASE $dbname CHARACTER SET utf8 COLLATE utf8_bin|); >+ >+ # Force C4::Context to recreate a new db handler >+ $dbh->disconnect; >+} >-- >2.8.1
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 16554
:
51619
|
51620
|
51621
|
51752
|
51753
|
51754
|
51755
|
51756
|
51757
|
51840
|
51890
|
51897
|
51898
|
51899
|
51900
|
54136
|
54137
|
54399
|
54404
|
54405
|
54406
|
54407
|
54408
|
54409
|
54410
|
54411
|
54412
|
54413
|
54414
|
54415
|
54416
|
55219
|
55220
|
55221
|
55222
|
55223
|
55224
|
55225
|
55226
|
55227
|
55228
|
55229
|
55230