This response definition is weird: 200: description: A sushi service schema: items: $ref: "../swagger.yaml#/definitions/erm_sushi_service" type: object `items` applies to `array` types. When digging in the tests and code to find out wether it returns an array of objects, or an object, I found out there are actually no tests for this endpoint! I'm removing the stray 'type: object' entry there because it makes some other tests fail. But please provide tests, and proof of the expected behavior.
Created attachment 158527 [details] [review] Bug 35218: Add unit tests for the counter registry API This patch adds two unit tests to cover the integration with the Counter Registry API in the Usage Statistics module. This is to prevent regressions caused either by changes to the Koha endpoint, or by changes to the Counter Registry API that might require changes in Koha to handle. Test plan: 1) prove t/db_dependent/api/v1/erm_counter_registries.t 2) prove t/db_dependent/api/v1/erm_sushi_services.t
Created attachment 158545 [details] [review] Bug 35218: Add unit tests for the counter registry API This patch adds two unit tests to cover the integration with the Counter Registry API in the Usage Statistics module. This is to prevent regressions caused either by changes to the Koha endpoint, or by changes to the Counter Registry API that might require changes in Koha to handle. Test plan: 1) prove t/db_dependent/api/v1/erm_counter_registries.t 2) prove t/db_dependent/api/v1/erm_sushi_services.t Signed-off-by: David Nind <david@davidnind.com>
Love the quick work... but QA test tools! FAIL t/db_dependent/api/v1/erm_counter_registries.t FAIL file permissions File must have the exec flag WARN tidiness The file is less tidy than before (bad/messy lines before: 0, now: 42) FAIL t/db_dependent/api/v1/erm_sushi_services.t FAIL file permissions File must have the exec flag WARN tidiness The file is less tidy than before (bad/messy lines before: 0, now: 33)
Created attachment 158546 [details] [review] Bug 35218: Add unit tests for the counter registry API This patch adds two unit tests to cover the integration with the Counter Registry API in the Usage Statistics module. This is to prevent regressions caused either by changes to the Koha endpoint, or by changes to the Counter Registry API that might require changes in Koha to handle. Test plan: 1) prove t/db_dependent/api/v1/erm_counter_registries.t 2) prove t/db_dependent/api/v1/erm_sushi_services.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 158547 [details] [review] Bug 35218: (QA follow-up) Perltidy and file permissions Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
I perltidied the whole test files, but still got stuck with a few missing lines?
Pushed to master for 23.11. Nice work everyone, thanks!
Depends on Bug 34587 not in 23.05.x
10:01 < Joubu> t/db_dependent/api/v1/erm_sushi_services.t is failing because it compares an expected output with https://registry.projectcounter.org/api/v1/sushi-service/b94bc981-fa16-4bf6-ba5f-6c113f7ffa0b/ 10:01 < Joubu> and there is "migrations" there 10:01 < Joubu> which may have been added recently 10:01 < Joubu> this test is really bad (ie. depending on an external resource) 10:02 < Joubu> unless it's what we want, but it's not clear what the test is actually testing