From e6fa73e84f1f51c44ee9281a642d16593ca1a43b Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Thu, 12 Dec 2024 09:58:46 +0100 Subject: [PATCH] Adapt tests to new messages from jsonschema 4.23.0 In the new jsonschema version couple of error messages are changed. As the tests should work with both old and the new jsonschema version the effected tests are relaxed to accept both error message. See https://review.opendev.org/c/openstack/requirements/+/925059 for the version bump patch where the tests are failing Change-Id: I21e5f5f72a46560f25d254e569b8d5cd15126fda --- placement/tests/functional/gabbits/allocations-1-12.yaml | 3 ++- .../tests/functional/gabbits/allocations-bug-1714072.yaml | 6 ++++-- .../tests/functional/gabbits/allocations-mappings.yaml | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/placement/tests/functional/gabbits/allocations-1-12.yaml b/placement/tests/functional/gabbits/allocations-1-12.yaml index 0b951347a..f29ab4725 100644 --- a/placement/tests/functional/gabbits/allocations-1-12.yaml +++ b/placement/tests/functional/gabbits/allocations-1-12.yaml @@ -63,7 +63,8 @@ tests: status: 400 response_strings: - JSON does not validate - - does not have enough properties + # jsonschema < 4.23.0 jsonschema >= 4.23.0 + - "/(does not have enough properties)|(should be non-empty)/" - name: put unused field PUT: /allocations/a0b15655-273a-4b3d-9792-2e579b7d5ad9 diff --git a/placement/tests/functional/gabbits/allocations-bug-1714072.yaml b/placement/tests/functional/gabbits/allocations-bug-1714072.yaml index fa25935b6..dcb0b4b30 100644 --- a/placement/tests/functional/gabbits/allocations-bug-1714072.yaml +++ b/placement/tests/functional/gabbits/allocations-bug-1714072.yaml @@ -62,7 +62,8 @@ tests: user_id: 66cb2f29-c86d-47c3-8af5-69ae7b778c70 status: 400 response_strings: - - does not have enough properties + # jsonschema < 4.23.0 jsonschema >= 4.23.0 + - "/(does not have enough properties)|(should be non-empty)/" # The next two tests confirm that the bug identified by # this file's name is not present in the PUT /allocations/{consumer_uuid} @@ -94,4 +95,5 @@ tests: user_id: 66cb2f29-c86d-47c3-8af5-69ae7b778c70 status: 400 response_strings: - - does not have enough properties + # jsonschema < 4.23.0 jsonschema >= 4.23.0 + - "/(does not have enough properties)|(should be non-empty)/" diff --git a/placement/tests/functional/gabbits/allocations-mappings.yaml b/placement/tests/functional/gabbits/allocations-mappings.yaml index 6583c0109..f993368b0 100644 --- a/placement/tests/functional/gabbits/allocations-mappings.yaml +++ b/placement/tests/functional/gabbits/allocations-mappings.yaml @@ -81,8 +81,8 @@ tests: user_id: 8c974f9a-f266-42f7-8613-a8017cbfb87F project_id: b2e599e0-ded8-47fd-b8ab-ceb7fca578bd status: 400 - response_json_paths: - $.errors[0].detail: "/JSON does not validate: {} does not have enough properties/" + response_json_paths: # jsonschema < 4.23.0 jsonschema >= 4.23.0 + $.errors[0].detail: "/JSON does not validate: {} (does not have enough properties)|(should be non-empty)/" - name: post allocation with results POST: /allocations