Bugzilla – Attachment 148213 Details for
Bug 33227
OpenAPI validation is failing for paths/biblios.yaml
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32227: Unit tests
Bug-32227-Unit-tests.patch (text/plain), 1.46 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-03-15 14:33:19 UTC
(
hide
)
Description:
Bug 32227: Unit tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-03-15 14:33:19 UTC
Size:
1.46 KB
patch
obsolete
>From 69cdf9943e270ed3f9f37e548e267885ab766469 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 15 Mar 2023 11:14:19 -0300 >Subject: [PATCH] Bug 32227: Unit tests > >This patch adds a unit test that launches the swagger-cli validator >against our spec. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >https://bugs.koha-community.org/show_bug.cgi?id=33227 >--- > xt/api.t | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > >diff --git a/xt/api.t b/xt/api.t >index 1dd206f498f..0dc8dccb869 100755 >--- a/xt/api.t >+++ b/xt/api.t >@@ -14,11 +14,14 @@ > > use Modern::Perl; > >-use Test::More tests => 2; >+use Test::More tests => 3; > > use Test::Mojo; > use Data::Dumper; > >+use FindBin(); >+use IPC::Cmd qw(can_run); >+ > my $t = Test::Mojo->new('Koha::REST::V1'); > my $spec = $t->get_ok( '/api/v1/', 'Correctly fetched the spec' )->tx->res->json; > >@@ -75,3 +78,18 @@ foreach my $route ( keys %{$paths} ) { > > is( scalar @missing_additionalProperties, 0 ) > or diag Dumper \@missing_additionalProperties; >+ >+subtest 'The spec passes the swagger-cli validation' => sub { >+ >+ plan tests => 1; >+ >+ SKIP: { >+ skip "Skipping tests, swagger-cli missing", 1 >+ unless can_run('swagger-cli'); >+ >+ my $spec_dir = "$FindBin::Bin/../api/v1/swagger"; >+ my $var = qx{swagger-cli validate $spec_dir/swagger.yaml 2>&1}; >+ is( $?, 0, 'Validation exit code is 0' ) >+ or diag $var; >+ } >+}; >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33227
:
148213
|
148214
|
148268
|
148269
|
148407
|
148408
|
148410
|
148411
|
168707