Summary: | Mock userenv should be a t::lib::Mocks method | ||
---|---|---|---|
Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
Component: | Test Suite | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | dcook, martin.renvoize, nick, tomascohen |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
Test suite enhancement backported to 18.11.x series to aid future backports. There should be no noticeable effects for the end user.
|
Version(s) released in: | |
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 21816, 22850 | ||
Attachments: |
Bug 21817: Centralize the mock of userenv from tests
Bug 21817: Centralize the mock of userenv from tests Bug 21817: Fix 2 failing tests Bug 21817: Centralize the mock of userenv from tests Bug 21817: Fix 2 failing tests Bug 21817: Centralize the mock of userenv from tests Bug 21817: Fix 2 failing tests Bug 21817: Centralize the mock of userenv from tests Bug 21817: Fix 2 failing tests |
Description
Jonathan Druart
2018-11-12 21:24:17 UTC
Created attachment 82250 [details] [review] Bug 21817: Centralize the mock of userenv from tests This patch adds a new method mock_userenv from t::lib::Mocks in order to simplify the mock of the userenv. Test plan: prove all the test files modified by this patch Created attachment 83023 [details] [review] Bug 21817: Centralize the mock of userenv from tests This patch adds a new method mock_userenv from t::lib::Mocks in order to simplify the mock of the userenv. Test plan: prove all the test files modified by this patch Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Good call.. all tests still pass for me after applying. Signed off. All looks good! But some new warnings are generated and some tests fail. To reproduce: $ kshell k$ git diff HEAD~ --name-only | grep -e '\.t$' | xargs prove => FAIL: Tests fail: ... t/db_dependent/Acquisition/NewOrder.t ........................ 1/8 # Failed test 'Koha::Acquisition::Order->store set created_by to logged in user if not given' # at t/db_dependent/Acquisition/NewOrder.t line 92. # got: '51' # expected: '42' # Looks like you failed 1 test of 8. t/db_dependent/Acquisition/NewOrder.t ........................ Dubious, test returned 1 (wstat 256, 0x100) Failed 1/8 subtests t/db_dependent/ArticleRequests.t ............................. ok t/db_dependent/Bookseller.t .................................. 28/86 # Failed test 'ordinary user can see only their library's subscriptions with IndependentBranches on' # at t/db_dependent/Bookseller.t line 667. # got: '0' # expected: '1' # Looks like you failed 1 test of 86. t/db_dependent/Bookseller.t .................................. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/86 subtests ... Created attachment 83052 [details] [review] Bug 21817: Fix 2 failing tests Created attachment 83123 [details] [review] Bug 21817: Centralize the mock of userenv from tests This patch adds a new method mock_userenv from t::lib::Mocks in order to simplify the mock of the userenv. Test plan: prove all the test files modified by this patch Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 83124 [details] [review] Bug 21817: Fix 2 failing tests Created attachment 83125 [details] [review] Bug 21817: Centralize the mock of userenv from tests This patch adds a new method mock_userenv from t::lib::Mocks in order to simplify the mock of the userenv. Test plan: prove all the test files modified by this patch Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 83126 [details] [review] Bug 21817: Fix 2 failing tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Please rebase Created attachment 83515 [details] [review] Bug 21817: Centralize the mock of userenv from tests This patch adds a new method mock_userenv from t::lib::Mocks in order to simplify the mock of the userenv. Test plan: prove all the test files modified by this patch Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 83516 [details] [review] Bug 21817: Fix 2 failing tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Awesome work all! Pushed to master for 19.05 At this early stage in the cycle, I have decided to backport this one as I'm envisaging it may be required by future ports and it doesn't cause any noticable changes for the end user. Pushed to 18.11.x for 18.11.02 RMaint note, I personally wouldn't feel the need to port this any further back than the 18.11.x series. |