Bugzilla – Attachment 46467 Details for
Bug 15517
Tables borrowers and deletedborrowers differ again
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 15517: deleted* tables won't never differ anymore!
PASSED-QA-Bug-15517-deleted-tables-wont-never-diff.patch (text/plain), 2.79 KB, created by
Katrin Fischer
on 2016-01-10 23:25:59 UTC
(
hide
)
Description:
[PASSED QA] Bug 15517: deleted* tables won't never differ anymore!
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2016-01-10 23:25:59 UTC
Size:
2.79 KB
patch
obsolete
>From d47ac8444f62cae938351c587f345bfc7856defd Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 7 Jan 2016 15:26:15 +0000 >Subject: [PATCH] [PASSED QA] Bug 15517: deleted* tables won't never differ > anymore! > >These tests will ensure that the 4 deleted* tables won't never differ >anymore. > >Test plan: >0/ Do not execute the update DB entry >1/ prove t/db_dependent/db_structure.t >should fail >2/ Execute the update DB entry and update the schema with >misc/devel/update_dbix_class_files.pl >3/ prove t/db_dependent/db_structure.t >should now be happy > >Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> >Test pass successfuly. Works as advertised > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > t/db_dependent/db_structure.t | 43 +++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 43 insertions(+) > create mode 100644 t/db_dependent/db_structure.t > >diff --git a/t/db_dependent/db_structure.t b/t/db_dependent/db_structure.t >new file mode 100644 >index 0000000..0288a98 >--- /dev/null >+++ b/t/db_dependent/db_structure.t >@@ -0,0 +1,43 @@ >+use Modern::Perl; >+ >+use Test::More tests => 409; >+use Koha::Database; >+ >+my @modules = ( >+ [ qw( Borrower Deletedborrower ) ], >+ [ qw( Biblio Deletedbiblio ) ], >+ [ qw( Biblioitem Deletedbiblioitem ) ], >+ [ qw( Item Deleteditem ) ], >+); >+ >+my @keys_to_check = qw( size is_nullable data_type accessor datetime_undef_if_invalid default_value ); >+ >+for my $modules ( @modules ) { >+ my $rs_1 = Koha::Database->new->schema->resultset($modules->[0]); >+ my $rs_2 = Koha::Database->new->schema->resultset($modules->[1]); >+ my $col_infos_1 = $rs_1->result_source->columns_info; >+ my $col_infos_2 = $rs_2->result_source->columns_info; >+ while ( my ( $column_name, $column_infos ) = each %$col_infos_1 ) { >+ while ( my ( $column_attribute, $value ) = each %$column_infos ) { >+ if ( grep {$_ eq $column_attribute} @keys_to_check ) { >+ my $val_1 = $col_infos_1->{$column_name}{$column_attribute}; >+ my $val_2 = $col_infos_2->{$column_name}{$column_attribute}; >+ # Dereference if we got a reference to a scalar >+ if ( ref($val_1) eq 'SCALAR' ) { >+ $val_1 = ${$val_1}; >+ $val_2 = ${$val_2}; >+ } >+ >+ if ( ref($val_1) eq 'ARRAY') { >+ is_deeply( $val_1, $val_2, >+ "tables related to $modules->[0] and $modules->[1] differs on $column_name.$column_attribute" >+ ); >+ } else { >+ is( $val_1, $val_2, >+ "tables related to $modules->[0] and $modules->[1] differs on $column_name.$column_attribute" >+ ); >+ } >+ } >+ } >+ } >+} >-- >1.9.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 15517
:
46403
|
46404
|
46457
|
46458
|
46466
| 46467 |
46472