Bugzilla – Attachment 43826 Details for
Bug 15052
Add diagnostic for the TestBuilder tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15052: Add diagnostic for the TestBuilder tests
Bug-15052-Add-diagnostic-for-the-TestBuilder-tests.patch (text/plain), 1.82 KB, created by
Tomás Cohen Arazi (tcohen)
on 2015-10-23 12:36:46 UTC
(
hide
)
Description:
Bug 15052: Add diagnostic for the TestBuilder tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2015-10-23 12:36:46 UTC
Size:
1.82 KB
patch
obsolete
>From 57f5332b63f2bc6b7728a4429d37f3de6d46d6ae Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 23 Oct 2015 09:32:18 +0100 >Subject: [PATCH] Bug 15052: Add diagnostic for the TestBuilder tests > >Sometimes t/db_dependent/TestBuilder.t fails with 'TestBuilder can >create a entry for every sources' but we don't know which ones have >failed. > >Test plan: >Create the following file: Koha/Schema/Result/Test.pm > package Koha::Schema::Result::Test; > use base 'DBIx::Class::Core'; > __PACKAGE__->table("test"); > 1; > >If you don't have a table named 'test' in your DB, > prove t/db_dependent/TestBuilder.t >should return a failure, but without any explanation. >With this patch you should get a diag and know what's wrong. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/TestBuilder.t | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/TestBuilder.t b/t/db_dependent/TestBuilder.t >index bec4834..70aa7cd 100644 >--- a/t/db_dependent/TestBuilder.t >+++ b/t/db_dependent/TestBuilder.t >@@ -30,12 +30,15 @@ my $builder = t::lib::TestBuilder->new(); > is( $builder->build(), undef, 'build without arguments returns undef' ); > > my @sources = $builder->schema->sources; >-my $nb_failure = 0; >+my @source_in_failure; > for my $source (@sources) { > eval { $builder->build( { source => $source } ); }; >- $nb_failure++ if ($@); >+ push @source_in_failure, $source if $@; >+} >+is( @source_in_failure, 0, 'TestBuilder should be able to create an object for every sources' ); >+if ( @source_in_failure ) { >+ diag ("The following sources have not been generated correctly: " . join ', ', @source_in_failure) > } >-is( $nb_failure, 0, 'TestBuilder can create a entry for every sources' ); > > my $my_overduerules_transport_type = { > message_transport_type => { >-- >2.6.2
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 15052
:
43807
| 43826