Bug 14748 - REST API Testing framework
Summary: REST API Testing framework
Status: RESOLVED WORKSFORME
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Olli-Antti Kivilahti
QA Contact:
URL:
Keywords:
Depends on: 13799 13920
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-27 17:26 UTC by Julian Maurice
Modified: 2024-07-03 06:42 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Medium patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 14748: REST API Testing framework (21.04 KB, patch)
2015-08-27 17:28 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 14748: (follow-up) Fix $testPackageName (1.24 KB, patch)
2015-09-15 13:59 UTC, Lari Taskula
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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?
Comment 9 Martin Renvoize (ashimema) 2024-07-03 06:42:31 UTC
As we now have some reasonable API testing patterns in place using test::mojo and testbuilder I think we can safely close this one.