Bugzilla – Attachment 177382 Details for
Bug 39007
Add last_audit to the sushi_service API spec
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39007: Update API spec and unit test
Bug-39007-Update-API-spec-and-unit-test.patch (text/plain), 2.33 KB, created by
Matt Blenkinsop
on 2025-01-31 13:16:48 UTC
(
hide
)
Description:
Bug 39007: Update API spec and unit test
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2025-01-31 13:16:48 UTC
Size:
2.33 KB
patch
obsolete
>From f13ff5de8df8d7d5b85c3375b125d20fc70fa7aa Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Fri, 31 Jan 2025 13:14:24 +0000 >Subject: [PATCH] Bug 39007: Update API spec and unit test > >Test plan: >1) Run prove t/db_dependent/api/v1/erm_sushi_services.t - FAIL >2) Apply patch >3) Repeat step 1 - PASS >4) Inspect patch diff and note that last_audit has been added to the API definition >--- > api/v1/swagger/definitions/erm_sushi_service.yaml | 3 +++ > t/db_dependent/api/v1/erm_sushi_services.t | 8 +++++++- > 2 files changed, 10 insertions(+), 1 deletion(-) > >diff --git a/api/v1/swagger/definitions/erm_sushi_service.yaml b/api/v1/swagger/definitions/erm_sushi_service.yaml >index 64d9452ea90..bd2988b9ec6 100644 >--- a/api/v1/swagger/definitions/erm_sushi_service.yaml >+++ b/api/v1/swagger/definitions/erm_sushi_service.yaml >@@ -114,6 +114,9 @@ properties: > type: array > items: > type: object >+ last_audit: >+ description: the last time the service was audited >+ type: object > > additionalProperties: false > >diff --git a/t/db_dependent/api/v1/erm_sushi_services.t b/t/db_dependent/api/v1/erm_sushi_services.t >index a6e712138f4..3de8fbee7fd 100755 >--- a/t/db_dependent/api/v1/erm_sushi_services.t >+++ b/t/db_dependent/api/v1/erm_sushi_services.t >@@ -21,6 +21,7 @@ use Modern::Perl; > > use Test::More tests => 1; > use Test::Mojo; >+use Test::Warn; > > use t::lib::TestBuilder; > use t::lib::Mocks; >@@ -61,6 +62,7 @@ subtest 'get() tests' => sub { > "id", > "ip_address_authorization", > "ip_address_authorization_info", >+ "last_audit", > "migrations", > "notification_count", > "notifications_url", >@@ -103,7 +105,11 @@ subtest 'get() tests' => sub { > my @response_fields = map { $_ } keys %$sushi_service; > my @new_fields_in_response = array_minus( @response_fields, @expected_fields ); > >- is( scalar(@new_fields_in_response), 0, 'The response fields match the expected fields' ); >+ my $new_fields_string = >+ "This is not a new error within Koha, the following new field(s) have been added to the API repsonse: " >+ . join( ', ', @new_fields_in_response ) >+ . '. They should be added to the API definition'; >+ warning_like { scalar(@new_fields_in_response) } 0, $new_fields_string; > > $schema->storage->txn_rollback; > }; >-- >2.48.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 39007
:
177381
|
177382
|
177390
|
177392
|
177463
|
178004
|
178005
|
178006