Bug 14748

Summary: REST API Testing framework
Product: Koha Reporter: Julian Maurice <julian.maurice>
Component: REST APIAssignee: Olli-Antti Kivilahti <olli-antti.kivilahti>
Status: Failed QA --- QA Contact:
Severity: enhancement    
Priority: P5 - low CC: bgkriegel, jonathan.druart, lari.taskula
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Medium patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 13799, 13920    
Bug Blocks:    
Attachments: Bug 14748: REST API Testing framework
Bug 14748: (follow-up) Fix $testPackageName

Description Julian Maurice 2015-08-27 17:26:44 UTC
REST API Testing framework
Comment 1 Julian Maurice 2015-08-27 17:28:04 UTC
Created attachment 42043 [details] [review]
Bug 14748: REST API Testing framework

Introduces the Swagger2TestRunner which takes care of authentication and
API consumer creation behind the scenes, and makes sure all API
endpoints get test coverage.

This way the test automator can focus on testing the business logic
instead of duplicating authentication and API consumer creation in
various test scripts.

Run t/db_dependent/Api/V1/testREST.pl and it will tell you what you need
to do.
Comment 2 Zeno Tajoli 2015-09-01 08:19:50 UTC
Patch complexity is 'Medium' because this change has many architectural connections
Comment 3 Lari Taskula 2015-09-15 13:59:41 UTC
Created attachment 42562 [details] [review]
Bug 14748: (follow-up) Fix $testPackageName
Comment 4 Lari Taskula 2015-09-15 14:03:53 UTC
Above patch fixes the following errors in testREST.pl: 

No test package defined for API route ... You must define it in t::db_dependent::Api::Apiv1::Borrowers-> ....
Comment 5 Bernardo Gonzalez Kriegel 2016-01-05 00:18:48 UTC
Hi, trying to test.
1) Need to install YAML::XS
2) Can't find Koha/ApiKeys.pm. Are there other dependencies for this bug?
Listed one (Bug 13799) is already in master.

Can't locate Koha/ApiKeys.pm in @INC (you may need to install the Koha::ApiKeys module)
Comment 6 Olli-Antti Kivilahti 2016-02-08 14:05:39 UTC
Hi!

This depends on the authentication system of the REST API which was under much scrutiny last time I checked.
Bug 13920
Comment 7 Bernardo Gonzalez Kriegel 2016-05-03 11:48:27 UTC
(In reply to Olli-Antti Kivilahti from comment #6)
> Hi!
> 
> This depends on the authentication system of the REST API which was under
> much scrutiny last time I checked.
> Bug 13920

That is in discussion, but not listed as dependency.
Anyway, more qa fails now

 FAIL   t/lib/RESTTest.pm
 FAIL   t/db_dependent/Api/V1/Borrowers.pm
 FAIL   t/db_dependent/Api/V1/testREST.pl
 FAIL   t/lib/Swagger2TestRunner.pm

and still the message "Can't locate Koha/ApiKeys.pm in @INC"
Comment 8 Katrin Fischer 2023-08-26 19:41:59 UTC
As bug 13920 was closed as WONTFIX, should this be closed as well?