Even if it is correct to use either authentication method, we are trying to clean our tests so consistency is key for users using existing tests as examples for the new ones they want/need to introduce. There are specific tests for the cookie (and OAuth2) authentication, so we can use the built-in Basic authentication mechanism from Test::Mojo and have simpler tests written. This bug should include patches to fix existing tests.
Test plan: 1. Apply this patches 2. Run: $ kshell k$ git diff origin/master --name-only | xargs prove => SUCCESS: Tests pass! 3. Sign off :-D
Created attachment 116211 [details] [review] Bug 27587: Adapt patrons_accounts.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 116212 [details] [review] Bug 27587: Adapt patrons_password.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 116213 [details] [review] Bug 27587: Adapt acquisitions_vendors.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 116214 [details] [review] Bug 27587: Adapt illrequests.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 116215 [details] [review] Bug 27587: Adapt stockrotationstage.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
I forgot to mention on the test plan: - Run: $ git grep "( 'SessionStorage', 'tmp' )" => SUCCESS: no API tests are old-style (besides auth ones, in which we explicitly want to test cookie auth).
Created attachment 116319 [details] [review] Bug 27587: Adapt patrons_accounts.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 116320 [details] [review] Bug 27587: Adapt patrons_password.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 116321 [details] [review] Bug 27587: Adapt acquisitions_vendors.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 116322 [details] [review] Bug 27587: Adapt illrequests.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 116323 [details] [review] Bug 27587: Adapt stockrotationstage.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Nice bit of tidy up.. passes qa scripts, unit tests still pass.. grep returns expected results. Going straight for QA here.. :)
Created attachment 116505 [details] [review] Bug 27587: Use Basic auth on API tests - patrons_accounts.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 116506 [details] [review] Bug 27587: Use Basic auth on API tests - patrons_password.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 116507 [details] [review] Bug 27587: Use Basic auth on API tests - acquisitions_vendors.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 116508 [details] [review] Bug 27587: Use Basic auth on API tests - illrequests.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 116509 [details] [review] Bug 27587: Use Basic auth on API tests - stockrotationstage.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Pushed to master for 21.05, thanks to everybody involved!
Enhancement not pushed to 20.11.x
Created attachment 118506 [details] [review] Bug 27857: Get the right column This patch makes the search for mandatory attribute types actually use 'code' instead of 'class' for comparisson. Tests are added to cover this behavior. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/Patron.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment on attachment 118506 [details] [review] Bug 27857: Get the right column Typo, wrong bug. Obsoletingi the last patch.