[open-ils-commits] [GIT] Evergreen ILS branch master updated. 4db8e49cf355eb03f353041bc3679dab935bd9f4

Evergreen Git git at git.evergreen-ils.org
Thu Apr 21 23:43:26 EDT 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  4db8e49cf355eb03f353041bc3679dab935bd9f4 (commit)
      from  0227dfd002b8538eeb71c47ebb229e4d954152f3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4db8e49cf355eb03f353041bc3679dab935bd9f4
Author: Jason Stephenson <jason at sigio.com>
Date:   Thu Apr 21 23:29:42 2016 -0400

    LP#1573372: Opt-in test broken because it uses bail-out.
    
    Use skip instead!
    
    Signed-off-by: Jason Stephenson <jason at sigio.com>
    Signed-off-by: Ben Shum <ben at evergreener.net>

diff --git a/Open-ILS/src/perlmods/live_t/15-lp1533329-opt-in.t b/Open-ILS/src/perlmods/live_t/15-lp1533329-opt-in.t
index 31b69ab..53337c6 100644
--- a/Open-ILS/src/perlmods/live_t/15-lp1533329-opt-in.t
+++ b/Open-ILS/src/perlmods/live_t/15-lp1533329-opt-in.t
@@ -53,122 +53,121 @@ sub opt_in_check {
     return $resp;
 }
 
-unless(opt_in_enabled()) {
-    BAIL_OUT('cannot test opt-in unless enabled in opensrf.xml');
-}
+SKIP: {
+    skip 'cannot test opt-in unless enabled in opensrf.xml', 12 unless(opt_in_enabled());
+
+    #----------------------------------------------------------------
+    # 1. Login, register workstation, get authtoken.
+    #----------------------------------------------------------------
+    $script->authenticate({
+        username => 'admin',
+        password => 'demo123',
+        type => 'staff'});
+    ok(
+        $script->authtoken,
+        'Have an authtoken'
+    );
+    my $ws = $script->register_workstation(WORKSTATION_NAME,WORKSTATION_LIB);
+    ok(
+        ! ref $ws,
+        'Registered a new workstation'
+    );
+    $script->logout();
+    $script->authenticate({
+        username => 'admin',
+        password => 'demo123',
+        type => 'staff',
+        workstation => WORKSTATION_NAME});
+    ok(
+        $script->authtoken,
+        'Have an authtoken associated with the workstation'
+    );
+
+    #----------------------------------------------------------------
+    # 2. Set org.patron_opt_boundary for SYS2, so that BR1 is outside
+    # the boundary.
+    #----------------------------------------------------------------
+    $e->xact_begin;
+    my $boundary = new_org_setting(PATRON_SYS, 'org.patron_opt_boundary', SYS_DEPTH);
+    my $boundary_stat = $e->create_actor_org_unit_setting($boundary);
+    ok($boundary_stat, 'Opt boundary setting created successfully');
+    $e->xact_commit;
+
+    #----------------------------------------------------------------
+    # 3. Check opt-in for test patron.  It should return 0.
+    #----------------------------------------------------------------
+    my $patron = $U->fetch_user_by_barcode(PATRON_BARCODE);
+    is(
+        opt_in_check($script->authtoken, $patron->id),
+        '0',
+        'Opt-in check for non-opted-in patron correctly returned 0'
+    );
 
-#----------------------------------------------------------------
-# 1. Login, register workstation, get authtoken.
-#----------------------------------------------------------------
-$script->authenticate({
-    username => 'admin',
-    password => 'demo123',
-    type => 'staff'});
-ok(
-    $script->authtoken,
-    'Have an authtoken'
-);
-my $ws = $script->register_workstation(WORKSTATION_NAME,WORKSTATION_LIB);
-ok(
-    ! ref $ws,
-    'Registered a new workstation'
-);
-$script->logout();
-$script->authenticate({
-    username => 'admin',
-    password => 'demo123',
-    type => 'staff',
-    workstation => WORKSTATION_NAME});
-ok(
-    $script->authtoken,
-    'Have an authtoken associated with the workstation'
-);
-
-#----------------------------------------------------------------
-# 2. Set org.patron_opt_boundary for SYS2, so that BR1 is outside
-# the boundary.
-#----------------------------------------------------------------
-$e->xact_begin;
-my $boundary = new_org_setting(PATRON_SYS, 'org.patron_opt_boundary', SYS_DEPTH);
-my $boundary_stat = $e->create_actor_org_unit_setting($boundary);
-ok($boundary_stat, 'Opt boundary setting created successfully');
-$e->xact_commit;
-
-#----------------------------------------------------------------
-# 3. Check opt-in for test patron.  It should return 0.
-#----------------------------------------------------------------
-my $patron = $U->fetch_user_by_barcode(PATRON_BARCODE);
-is(
-    opt_in_check($script->authtoken, $patron->id),
-    '0',
-    'Opt-in check for non-opted-in patron correctly returned 0'
-);
-
-#----------------------------------------------------------------
-# 4. Set org.restrict_opt_to_depth at SYS2, so that BR1 is
-# outside SYS2's section of the tree at the specified depth (thus
-# preventing opt-in).
-#----------------------------------------------------------------
-$e->xact_begin;
-my $restrict = new_org_setting(PATRON_SYS, 'org.restrict_opt_to_depth', SYS_DEPTH);
-my $restrict_stat = $e->create_actor_org_unit_setting($restrict);
-ok($restrict_stat, 'Opt restrict depth setting created successfully');
-$e->xact_commit;
-
-#----------------------------------------------------------------
-# 5. Check opt-in for test patron.  It should return 2.
-#----------------------------------------------------------------
-is(
-    opt_in_check($script->authtoken, $patron->id),
-    '2',
-    'Opt-in check for patron at restricted opt-in library correctly returned 2'
-);
-
-#----------------------------------------------------------------
-# 6. Remove the org.restrict_opt_to_depth setting for SYS2.
-#----------------------------------------------------------------
-$e->xact_begin;
-my $delete_restrict_stat = $e->delete_actor_org_unit_setting($restrict);
-ok($delete_restrict_stat, 'Opt restrict depth setting deleted successfully');
-$e->xact_commit;
-
-#----------------------------------------------------------------
-# 7. Create opt-in for test patron.
-#----------------------------------------------------------------
-my $opt_id = $U->simplereq(
-    'open-ils.actor',
-    'open-ils.actor.user.org_unit_opt_in.create',
-    $script->authtoken, $patron->id, WORKSTATION_LIB);
-ok($opt_id, 'Patron successfully opted in');
-
-#----------------------------------------------------------------
-# 8. Check opt-in for test patron.  It should return 1.
-#----------------------------------------------------------------
-is(
-    opt_in_check($script->authtoken, $patron->id),
-    '1',
-    'Opt-in check for opted-in patron correctly returned 1'
-);
-
-#----------------------------------------------------------------
-# 9. Delete opt-in.
-#----------------------------------------------------------------
-my $opt = $U->simplereq(
-    'open-ils.cstore',
-    'open-ils.cstore.direct.actor.usr_org_unit_opt_in.retrieve',
-    $opt_id
-);
-$e->xact_begin;
-my $delete_opt_stat = $e->delete_actor_usr_org_unit_opt_in($opt);
-ok($delete_opt_stat, 'Opt-in deleted successfully');
-$e->xact_commit;
-
-#----------------------------------------------------------------
-# 10. Remove opt boundary setting.
-#----------------------------------------------------------------
-$e->xact_begin;
-my $delete_setting_stat = $e->delete_actor_org_unit_setting($boundary);
-ok($delete_setting_stat, 'Opt boundary setting deleted successfully');
-$e->xact_commit;
+    #----------------------------------------------------------------
+    # 4. Set org.restrict_opt_to_depth at SYS2, so that BR1 is
+    # outside SYS2's section of the tree at the specified depth (thus
+    # preventing opt-in).
+    #----------------------------------------------------------------
+    $e->xact_begin;
+    my $restrict = new_org_setting(PATRON_SYS, 'org.restrict_opt_to_depth', SYS_DEPTH);
+    my $restrict_stat = $e->create_actor_org_unit_setting($restrict);
+    ok($restrict_stat, 'Opt restrict depth setting created successfully');
+    $e->xact_commit;
+
+    #----------------------------------------------------------------
+    # 5. Check opt-in for test patron.  It should return 2.
+    #----------------------------------------------------------------
+    is(
+        opt_in_check($script->authtoken, $patron->id),
+        '2',
+        'Opt-in check for patron at restricted opt-in library correctly returned 2'
+    );
+
+    #----------------------------------------------------------------
+    # 6. Remove the org.restrict_opt_to_depth setting for SYS2.
+    #----------------------------------------------------------------
+    $e->xact_begin;
+    my $delete_restrict_stat = $e->delete_actor_org_unit_setting($restrict);
+    ok($delete_restrict_stat, 'Opt restrict depth setting deleted successfully');
+    $e->xact_commit;
+
+    #----------------------------------------------------------------
+    # 7. Create opt-in for test patron.
+    #----------------------------------------------------------------
+    my $opt_id = $U->simplereq(
+        'open-ils.actor',
+        'open-ils.actor.user.org_unit_opt_in.create',
+        $script->authtoken, $patron->id, WORKSTATION_LIB);
+    ok($opt_id, 'Patron successfully opted in');
+
+    #----------------------------------------------------------------
+    # 8. Check opt-in for test patron.  It should return 1.
+    #----------------------------------------------------------------
+    is(
+        opt_in_check($script->authtoken, $patron->id),
+        '1',
+        'Opt-in check for opted-in patron correctly returned 1'
+    );
 
+    #----------------------------------------------------------------
+    # 9. Delete opt-in.
+    #----------------------------------------------------------------
+    my $opt = $U->simplereq(
+        'open-ils.cstore',
+        'open-ils.cstore.direct.actor.usr_org_unit_opt_in.retrieve',
+        $opt_id
+    );
+    $e->xact_begin;
+    my $delete_opt_stat = $e->delete_actor_usr_org_unit_opt_in($opt);
+    ok($delete_opt_stat, 'Opt-in deleted successfully');
+    $e->xact_commit;
+
+    #----------------------------------------------------------------
+    # 10. Remove opt boundary setting.
+    #----------------------------------------------------------------
+    $e->xact_begin;
+    my $delete_setting_stat = $e->delete_actor_org_unit_setting($boundary);
+    ok($delete_setting_stat, 'Opt boundary setting deleted successfully');
+    $e->xact_commit;
+}
 

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/perlmods/live_t/15-lp1533329-opt-in.t |  231 ++++++++++----------
 1 files changed, 115 insertions(+), 116 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list