Bugzilla – Attachment 119937 Details for
Bug 27857
Koha::Patron->extended_attributes skips checks
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27857: Start a transaction foreach subtest
Bug-27857-Start-a-transaction-foreach-subtest.patch (text/plain), 3.19 KB, created by
Jonathan Druart
on 2021-04-21 07:48:13 UTC
(
hide
)
Description:
Bug 27857: Start a transaction foreach subtest
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-04-21 07:48:13 UTC
Size:
3.19 KB
patch
obsolete
>From fed444c006e8d6cf66d93c2091047e7f671d75ae Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 21 Apr 2021 09:44:58 +0200 >Subject: [PATCH] Bug 27857: Start a transaction foreach subtest > >There is a random failure > > # Looks like you planned 15 tests but ran 2. > > # Failed test 'extended_attributes' > # at t/db_dependent/Koha/Patron.t line 664. > Missing mandatory extended attribute (type=B0vCQxlI)# Looks like your test exited with 255 just after 7. > [17:00:24] t/db_dependent/Koha/Patron.t >--- > t/db_dependent/Koha/Patron.t | 23 ++++++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Patron.t b/t/db_dependent/Koha/Patron.t >index c5a2cbfd90..7bcd427da4 100755 >--- a/t/db_dependent/Koha/Patron.t >+++ b/t/db_dependent/Koha/Patron.t >@@ -499,10 +499,14 @@ subtest 'extended_attributes' => sub { > #$limited_value = $patron_1->get_extended_attribute( $attribute_type_limited->code ); > #is( $limited_value, undef, ); > >+ $schema->storage->txn_rollback; >+ > subtest 'non-repeatable attributes tests' => sub { > > plan tests => 3; > >+ $schema->storage->txn_begin; >+ > my $patron = $builder->build_object({ class => 'Koha::Patrons' }); > my $attribute_type = $builder->build_object( > { >@@ -526,12 +530,17 @@ subtest 'extended_attributes' => sub { > 'Exception thrown on non-repeatable attribute'; > > is( $patron->extended_attributes->count, 0, 'Extended attributes storing rolled back' ); >+ >+ $schema->storage->txn_rollback; >+ > }; > > subtest 'unique attributes tests' => sub { > > plan tests => 5; > >+ $schema->storage->txn_begin; >+ > my $patron_1 = $builder->build_object({ class => 'Koha::Patrons' }); > my $patron_2 = $builder->build_object({ class => 'Koha::Patrons' }); > >@@ -573,12 +582,17 @@ subtest 'extended_attributes' => sub { > > is( $patron_1->extended_attributes->count, 2, 'Extended attributes stored' ); > is( $patron_2->extended_attributes->count, 0, 'Extended attributes storing rolled back' ); >+ >+ $schema->storage->txn_rollback; >+ > }; > > subtest 'invalid type attributes tests' => sub { > > plan tests => 3; > >+ $schema->storage->txn_begin; >+ > my $patron = $builder->build_object({ class => 'Koha::Patrons' }); > > my $attribute_type_1 = $builder->build_object( >@@ -612,12 +626,17 @@ subtest 'extended_attributes' => sub { > 'Exception thrown on invalid attribute type'; > > is( $patron->extended_attributes->count, 0, 'Extended attributes storing rolled back' ); >+ >+ $schema->storage->txn_rollback; >+ > }; > > subtest 'globally mandatory attributes tests' => sub { > > plan tests => 5; > >+ $schema->storage->txn_begin; >+ > my $patron = $builder->build_object({ class => 'Koha::Patrons' }); > > my $attribute_type_1 = $builder->build_object( >@@ -658,7 +677,9 @@ subtest 'extended_attributes' => sub { > ); > > is( $patron->extended_attributes->count, 1, 'Extended attributes succeeded' ); >+ >+ $schema->storage->txn_rollback; >+ > }; > >- $schema->storage->txn_rollback; > }; >-- >2.20.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 27857
:
117709
|
117710
|
117711
|
117938
|
117945
|
117946
|
117947
|
117948
|
117953
|
117954
|
117955
|
117956
|
117957
|
119009
|
119038
|
119040
|
119443
| 119937 |
119938