Summary: | t/Ediorder.t tests failing on 22.05.02 | ||
---|---|---|---|
Product: | Koha | Reporter: | Aleisha Amohia <aleisha> |
Component: | Acquisitions | Assignee: | Martin Renvoize (ashimema) <martin.renvoize> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | critical | ||
Priority: | P5 - low | CC: | arthur.suzuki, chris, jonathan.druart, lucas, wainuiwitikapark |
Version: | 22.05 | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
22.11.00, 22.05.05
|
|
Circulation function: | |||
Bug Depends on: | 30135 | ||
Bug Blocks: | |||
Attachments: |
Bug 31134: Mock EdifactLSQ for t/Edifact.t
Bug 31134: Mock EdifactLSQ for t/Edifact.t Bug 31134: Mock EdifactLSQ for t/Edifact.t |
Description
Aleisha Amohia
2022-07-12 02:09:30 UTC
% git checkout v22.05.02) % reset_all % prove t/Ediorder.t All tests successful. Works for me. And Jenkins is happy as well. Ok If I checkout the branch it fails Failed test 'Single Gir field OK' # at t/Ediorder.t line 104. # got: 'GIR+001+BUDGET:LFN+BRANCH:LLO+TYPE:LST+CALL:LSM' # expected: 'GIR+001+BUDGET:LFN+BRANCH:LLO+TYPE:LST+LOCATION:LSQ+CALL:LSM' Use of uninitialized value $lsq_field in hash element at /home/vagrant/kohaclone/Koha/Edifact/Order.pm line 563. Use of uninitialized value $lsq_field in hash element at /home/vagrant/kohaclone/Koha/Edifact/Order.pm line 563. Use of uninitialized value $got in string eq at (eval in cmp_ok) t/Ediorder.t line 117. # Failed test 'First part of split Gir field OK' # at t/Ediorder.t line 117. # got: undef # expected: 'GIR+002+BUDGET:LFN+BRANCH:LLO+TYPE:LST+LOCATION:LSQ+CALL:LSM' Use of uninitialized value $got in string eq at (eval in cmp_ok) t/Ediorder.t line 123. # Failed test 'Second part of split GIR field OK' # at t/Ediorder.t line 123. # got: undef # expected: 'GIR+002+S_I:LVT' # Looks like you failed 3 tests of 13. This is because this test is now db_dependent Koha/Edifact/Order.pm: my $lsq_field = C4::Context->preference('EdifactLSQ'); So it needs to probably be moved out of t, or that syspref needs to be mocked. The reason it works is if that syspref is set location. If I set the syspref to collection, the tests fail, if i set it location the tests pass. The problem is then when you are building a package you dont have a database, the t/ tests should all pass without relying on a syspref fetched from a db. Chris Martin, can you have a look at this? Created attachment 137710 [details] [review] Bug 31134: Mock EdifactLSQ for t/Edifact.t This patch adds a mock for the EdifactLSQ preference so we can consistently pass when a database is not available. Thanks for drawing my attention to this one.. should work with the patch attached :) Created attachment 137711 [details] [review] Bug 31134: Mock EdifactLSQ for t/Edifact.t This patch adds a mock for the EdifactLSQ preference so we can consistently pass when a database is not available. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 137714 [details] [review] Bug 31134: Mock EdifactLSQ for t/Edifact.t This patch adds a mock for the EdifactLSQ preference so we can consistently pass when a database is not available. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Pushed to master for 22.11. Nice work everyone, thanks! Backported to 22.05.x for 22.05.05 depends on 30135 not released in 21.11.x. won't backport. |