[Koha-bugs] [Bug 18137] REST API: Migrate from Mojolicious::Plugin:: Swagger2 to Mojolicious::Plugin::OpenAPI

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Mar 13 16:54:46 CET 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18137

--- Comment #25 from Lari Taskula <lari.taskula at jns.fi> ---
(In reply to Mirko Tietgen from comment #24)
> I submitted Mojolicious::Plugin::OpenAPI to Debian a few days ago (1.10).
> 1.13 is out by now. And both versions depend on versions of
> libjson-validator-perl not yet in Debian unstable, and the tests in the
> latest version are broken.
Thanks for looking at this Mirko! 

I had a look at JSON::Validator version 0.96. There indeed seemed to be some
issues with the tests in the latest version. I noticed there is a commit to
json-validator in GitHub as well as some IRC discussion in #swagger
@irc.perl.org suggesting that tests are broken on an older version of
Test::More. Using the latest version of Test::More passes the tests. I tested
an older version of Test::More (1.001014) and tests are indeed failing:

$ sudo cpanm Test::More at 1.001014
--> Working on Test::More
Fetching
http://backpan.perl.org/authors/id/E/EX/EXODIST/Test-Simple-1.001014.tar.gz ...
OK
Configuring Test-Simple-1.001014 ... OK
Building and testing Test-Simple-1.001014 ... OK
Successfully installed Test-Simple-1.001014 (downgraded from 1.302078)
1 distribution installed
$ prove t
..
..
Test Summary Report
-------------------
t/acceptance.t                       (Wstat: 0 Tests: 265 Failed: 0)
  TODO passed:   45-47, 49-52, 56-57
t/jv-formats.t                       (Wstat: 256 Tests: 28 Failed: 1)
  Failed test:  27
  Non-zero exit status: 1
t/jv-object.t                        (Wstat: 256 Tests: 19 Failed: 1)
  Failed test:  18
  Non-zero exit status: 1
t/openapi-formats.t                  (Wstat: 512 Tests: 24 Failed: 2)
  Failed tests:  12, 22
  Non-zero exit status: 2
t/openapi-response.t                 (Wstat: 0 Tests: 7 Failed: 0)
  TODO passed:   1
t/openapi.t                          (Wstat: 0 Tests: 8 Failed: 0)
  TODO passed:   1
Files=44, Tests=558, 11 wallclock secs ( 0.24 usr  0.06 sys +  9.82 cusr  1.04
csys = 11.16 CPU)
Result: FAIL

Whereas the new version passes:

$ sudo cpanm Test::More
--> Working on Test::More
Fetching
http://www.cpan.org/authors/id/E/EX/EXODIST/Test-Simple-1.302078.tar.gz ... OK
Configuring Test-Simple-1.302078 ... OK
Building and testing Test-Simple-1.302078 ... OK
Successfully installed Test-Simple-1.302078 (upgraded from 1.001014)
1 distribution installed
$ prove t
..
..
All tests successful.

Test Summary Report
-------------------
t/acceptance.t                       (Wstat: 0 Tests: 265 Failed: 0)
  TODO passed:   45-47, 49-52, 56-57
t/jv-object.t                        (Wstat: 0 Tests: 19 Failed: 0)
  TODO passed:   9
t/openapi-formats.t                  (Wstat: 0 Tests: 24 Failed: 0)
  TODO passed:   7, 10-11
t/openapi-response.t                 (Wstat: 0 Tests: 7 Failed: 0)
  TODO passed:   1
t/openapi.t                          (Wstat: 0 Tests: 8 Failed: 0)
  TODO passed:   1
Files=44, Tests=558, 12 wallclock secs ( 0.23 usr  0.08 sys + 10.66 cusr  1.12
csys = 12.09 CPU)
Result: PASS

Could this be related to the issue you were having with the tests?

Anyway, as a side note to comment #18, Mojolicious::Plugin::OpenAPI 1.13 has a
requirement for JSON::Validator 0.95, which is not enough for us. We need
JSON::Validator 0.96 or newer. It will be a requirement in currently unreleased
Mojolicious::Plugin::OpenAPI version 1.14. Should we wait for that or
explicitly define requirement for JSON::Validator 0.96 in PerlDependencies.pm?

What comes to Mojolicious - I've attempted to run our REST API on Mojolicious
7.26 and so far it seems ok. Tests are also passing for me.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list