Skip to content

Commit

Permalink
test(udm-rest-api): fix 73_udm-rest/01_openapi_validation
Browse files Browse the repository at this point in the history
It was caused by the new [4.6 version of typing-extensions](https://github.com/python/typing_extensions/blob/main/CHANGELOG.md#release-460-may-22-2023) used by jsonschema-spec to validate protocol.

>    isinstance() checks against runtime-checkable protocols now use inspect.getattr_static() rather than hasattr() to lookup whether attributes exist (backporting python/cpython#103034). This means that descriptors and getattr methods are no longer unexpectedly evaluated during isinstance() checks against runtime-checkable protocols. However, it may also mean that some objects which used to be considered instances of a runtime-checkable protocol on older versions of typing_extensions may no longer be considered instances of that protocol using the new release, and vice versa. Most users are unlikely to be affected by this change. Patch by Alex Waygood.

Temporary workaround will be downgrading typing-extensions to version below 4.6:

    pip install "typing-extensions<4.6"

Bug #50048
  • Loading branch information
spaceone committed Jun 10, 2023
1 parent 610476a commit 8c4ebfd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions test/ucs-test/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
ucs-test (10.0.11-1) unstable; urgency=medium

* Bug #50048: fix 73_udm-rest/01_openapi_validation

-- Florian Best <best@univention.de> Sat, 10 Jun 2023 13:58:22 +0200

ucs-test (10.0.10-69) unstable; urgency=medium

* Bug #31388: add "read list" to 53_samba-common/10samba-share-options
Expand Down
4 changes: 3 additions & 1 deletion test/ucs-test/tests/73_udm-rest/01_openapi_validation
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ cleanup() {
trap cleanup INT TERM EXIT

python3 -m pip install -U pip
python3 -m pip install openapi-spec-validator==0.4.0
python3 -m pip install "typing-extensions<4.6"
python3 -m pip install openapi-spec-validator


curl -u "$(ucs_convertDN2UID ${tests_domainadmin_account})":"${tests_domainadmin_pwd}" http://localhost/univention/udm/openapi.json | python3 -m openapi_spec_validator - || fail_fast 1

0 comments on commit 8c4ebfd

Please sign in to comment.