Bugzilla – Attachment 130215 Details for
Bug 29754
Patron fines counted twice for SIP when NoIssuesChargeGuarantorsWithGuarantees is enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29754: (QA follow-up) Minor tests tweaks
Bug-29754-QA-follow-up-Minor-tests-tweaks.patch (text/plain), 2.96 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-02-07 12:03:47 UTC
(
hide
)
Description:
Bug 29754: (QA follow-up) Minor tests tweaks
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-02-07 12:03:47 UTC
Size:
2.96 KB
patch
obsolete
>From 75cd13f9365e3af445045ba53075d686caed26cd Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 7 Feb 2022 08:58:43 -0300 >Subject: [PATCH] Bug 29754: (QA follow-up) Minor tests tweaks > >This patch does two things: > >- Wraps the new SIP tests in a single transaction. We do that to avoid > sub-test interference, specially when test files get big. The provided > tests are correct and don't require previous tests data. >- Migrated from the introduced 'diag' calls to 'note', as I just learned > they are the same, but 'note' is only displayed when in verbose mode. > Which is great to avoid unnecessary noise in Jenkins. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Patron.t | 4 ++-- > t/db_dependent/SIP/Patron.t | 6 +++++- > 2 files changed, 7 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Koha/Patron.t b/t/db_dependent/Koha/Patron.t >index 8c73e7aa0c..380bba455f 100755 >--- a/t/db_dependent/Koha/Patron.t >+++ b/t/db_dependent/Koha/Patron.t >@@ -135,7 +135,7 @@ subtest 'relationships_debt() tests' => sub { > > sub _test_combinations { > my ( $patrons, $parent1_debt, $parent2_debt, $child1_debt, $child2_debt ) = @_; >- diag("Testing with parent 1 debt $parent1_debt | Parent 2 debt $parent2_debt | Child 1 debt $child1_debt | Child 2 debt $child2_debt"); >+ note("Testing with parent 1 debt $parent1_debt | Parent 2 debt $parent2_debt | Child 1 debt $child1_debt | Child 2 debt $child2_debt"); > # Options > # P1 => P1 + C1 + C2 ( - P1 ) ( + P2 ) > # P2 => P2 + C1 + C2 ( - P2 ) ( + P1 ) >@@ -146,7 +146,7 @@ sub _test_combinations { > for my $i ( 0 .. 7 ) { > my ( $only_this_guarantor, $include_guarantors, $include_this_patron ) > = split '', sprintf( "%03b", $i ); >- diag("---------------------"); >+ note("---------------------"); > for my $patron ( @$patrons ) { > if ( $only_this_guarantor > && !$patron->guarantee_relationships->count ) >diff --git a/t/db_dependent/SIP/Patron.t b/t/db_dependent/SIP/Patron.t >index f0a1f26dce..15b8827da2 100755 >--- a/t/db_dependent/SIP/Patron.t >+++ b/t/db_dependent/SIP/Patron.t >@@ -272,12 +272,16 @@ subtest "fine_items tests" => sub { > is( @$fine_items, 0, "Got zero fine items" ); > }; > >+$schema->storage->txn_rollback; >+ > subtest "NoIssuesChargeGuarantorsWithGuarantees tests" => sub { > > plan tests => 1; > > t::lib::Mocks::mock_preference( 'borrowerRelationship', 'parent' ); > >+ $schema->storage->txn_begin; >+ > my $patron = $builder->build_object({ class => 'Koha::Patrons' }); > my $child = $builder->build_object({ class => 'Koha::Patrons' }); > $child->add_guarantor({ guarantor_id => $patron->borrowernumber, relationship => 'parent' }); >@@ -308,5 +312,5 @@ subtest "NoIssuesChargeGuarantorsWithGuarantees tests" => sub { > > is( $sip_patron->fines_amount, 11.11,"Guarantee fines correctly included"); > >+ $schema->storage->txn_rollback; > }; >-$schema->storage->txn_rollback; >-- >2.32.0
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 29754
:
128863
|
128864
|
129732
|
129733
|
130213
|
130214
| 130215