Bug 22618

Summary: Tests in t/Acquisition.t are actually context dependent
Product: Koha Reporter: Kyle M Hall (khall) <kyle>
Component: Architecture, internals, and plumbingAssignee: Nick Clemens (kidclamp) <nick>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: lucas, martin.renvoize, nick, tomascohen, wizzyrea
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.05.00, 18.11.05
Circulation function:
Bug Depends on: 18736    
Bug Blocks:    
Attachments: Bug 22618: Move tests to t/db_dependent/Acquisition.t
Bug 22618: Move tests to t/db_dependent/Acquisition.t
Bug 22618: Move tests to t/db_dependent/Acquisition.t

Description Kyle M Hall (khall) 2019-04-01 17:03:13 UTC
Here are the results of running t/Acquisition.t without a database set up:

t/Acquisition.t .. unable to locate Koha configuration file koha-conf.xml at C4/Context.pm line 244.
unable to locate Koha configuration file koha-conf.xml at C4/Context.pm line 244.
unable to locate Koha configuration file koha-conf.xml at C4/Context.pm line 244.
unable to locate Koha configuration file koha-conf.xml at C4/Context.pm line 244.
unable to locate Koha configuration file koha-conf.xml at C4/Context.pm line 244.
unable to locate Koha configuration file koha-conf.xml at C4/Context.pm line 244.
Use of uninitialized value in concatenation (.) or string at C4/Templates.pm line 154.
unable to locate Koha configuration file koha-conf.xml at C4/Context.pm line 244.
unable to locate Koha configuration file koha-conf.xml at C4/Context.pm line 244.
Use of uninitialized value in concatenation (.) or string at C4/Auth_with_cas.pm line 42.
unable to locate Koha configuration file koha-conf.xml at C4/Context.pm line 244.
t/Acquisition.t .. 1/3 unable to locate Koha configuration file koha-conf.xml at C4/Context.pm line 244.
Can't call method "config" on unblessed reference at Koha/Database.pm line 56.
    # Child (Test for get_rounded_price) exited without calling finalize()

#   Failed test 'Test for get_rounded_price'
#   at /usr/local/share/perl/5.20.2/Test/Builder.pm line 279.
# Looks like you failed 1 test of 3.
# Looks like your test exited with 2 just after 3.
t/Acquisition.t .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 1/3 subtests

Test Summary Report
-------------------
t/Acquisition.t (Wstat: 512 Tests: 3 Failed: 1)
  Failed test:  3
  Non-zero exit status: 2
Files=1, Tests=3,  3 wallclock secs ( 0.03 usr  0.02 sys +  2.11 cusr  0.13 csys =  2.29 CPU)
Result: FAIL

These tests should be moved to a file in t/db_dependent
Comment 1 Nick Clemens (kidclamp) 2019-04-02 18:02:52 UTC
Created attachment 87328 [details] [review]
Bug 22618: Move tests to t/db_dependent/Acquisition.t

prove -v t/db_dependent/Acquisition.t
Comment 2 Michal Denar 2019-04-02 22:00:13 UTC
Created attachment 87336 [details] [review]
Bug 22618: Move tests to t/db_dependent/Acquisition.t

prove -v t/db_dependent/Acquisition.t

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 3 Tomás Cohen Arazi (tcohen) 2019-04-05 18:42:27 UTC
Created attachment 87464 [details] [review]
Bug 22618: Move tests to t/db_dependent/Acquisition.t

prove -v t/db_dependent/Acquisition.t

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Nick Clemens (kidclamp) 2019-04-10 20:14:57 UTC
Awesome work all!

Pushed to master for 19.05
Comment 5 Martin Renvoize (ashimema) 2019-04-15 11:05:32 UTC
Pushed to 18.11.x for 18.11.05
Comment 6 Lucas Gass (lukeg) 2019-04-16 20:21:44 UTC
missing dependency for 18.05.x, not backporting