Some DeprecationWarnings are seen in tempest-full-py3 job

Bug #2008490 reported by Nozomi Kawamoto
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Low
Nozomi Kawamoto

Bug Description

Description
==================
The following DeprecationWarning messages are seen in tempest-full-py3 job.

~~~
/opt/stack/tempest/tempest/lib/common/jsonschema_validator.py:21: DeprecationWarning: Accessing jsonschema.draft4_format_checker is deprecated and will be removed in a future release. Instead, use the FORMAT_CHECKER attribute on the corresponding Validator.
   FORMAT_CHECKER = jsonschema.draft4_format_checker

...

/opt/stack/tempest/tempest/lib/common/jsonschema_validator.py:42: DeprecationWarning: FormatChecker.cls_checks is deprecated. Call FormatChecker.checks on a specific FormatChecker instance instead.
   @jsonschema.FormatChecker.cls_checks('base64')
~~~

Please see the latest build logs for the details[1].

[1] https://zuul.openstack.org/builds?job_name=tempest-full-py3&skip=0

Steps to reproduce
==================
1. Setup tempest
2. Run the below command
   $ tox -evenv -- tempest verify-config -uro /tmp/tmp-verify-config

Expected result
==================
Completing the `tempest verify-config` command without unnecessary warnings.

Actual result
==================
Some DeprecationWarnings appeared every time when running `tempest verify-config`.

Environment
==================
- Devstack
- Ubuntu22.04

Logs & Configs
==================
N/A

Changed in tempest:
assignee: nobody → Nozomi Kawamoto (nkawamot)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/tempest/+/875264

Changed in tempest:
status: New → In Progress
Changed in tempest:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.opendev.org/c/openstack/tempest/+/875264
Committed: https://opendev.org/openstack/tempest/commit/d52fb8cb6d2ed8893bc36f2f1f786cd890b1732e
Submitter: "Zuul (22348)"
Branch: master

commit d52fb8cb6d2ed8893bc36f2f1f786cd890b1732e
Author: Nozomi Kawamoto <email address hidden>
Date: Sat Feb 25 00:33:46 2023 +0900

    Fix DeprecationWarning of jsonschema

    `jsonschema.draft4_format_checker` and also `jsonschema.FormatChecker.cls_checks`
    are deprecated and DeprecationWarning appears every time so these make
    logs a little dirty and also these attribute/classmethod will be removed
    in the future.

    Therefore `jsonschema.draft4_format_checker` should be replaced with
    `jsonschema.Draft4Validator.FORMAT_CHECKER` and
    `jsonschema.FormatChecker.cls_checks` should be replaced with
    `jsonschema.Draft4Validator.FORMAT_CHECKER.checks`.

    Eventually, DeprecationWarning for jsonschema will disappear with this
    proposed fix.

    Closes-Bug: #2008490
    Change-Id: I1ef326b8ac17f4bbcbc718d13223da156b0e5ec3

Changed in tempest:
status: In Progress → Fix Released
Revision history for this message
Hemanth Nakkina (hemanth-n) wrote :

Please see the comment from Joel on https://review.opendev.org/c/openstack/tempest/+/875264,

the minimum version of jsonschema package in requirements file need to be changed.

Revision history for this message
Nozomi Kawamoto (nkawamot) wrote :

Oh, I've missed that point out. I'll update the requirements file.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/tempest/+/875752

Revision history for this message
Nozomi Kawamoto (nkawamot) wrote :

I've proposed a fix so would someone please review the patch?

Revision history for this message
Martin Kopec (mkopec) wrote :

Thanks Nozomi, I reviewed and merged the patch.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.opendev.org/c/openstack/tempest/+/875752
Committed: https://opendev.org/openstack/tempest/commit/e2315c1cf55b8eb7996c61bed85313d5ff90d07f
Submitter: "Zuul (22348)"
Branch: master

commit e2315c1cf55b8eb7996c61bed85313d5ff90d07f
Author: Nozomi Kawamoto <email address hidden>
Date: Wed Mar 1 00:38:22 2023 +0900

    Update required minimum jsonschema version >= 4.16.0

    DeprecationWarnings for jsonschema has been fixed at below path.

    https://review.opendev.org/c/openstack/tempest/+/875264

    But it is required to update the minimum jsonschema version >= 4.16.0
    for including a below commit.

    https://github.com/python-jsonschema/jsonschema/commit/ee024ffc61bee56b25e816f489d7365fe1445c6d

    Closes-Bug: #2008490
    Change-Id: I0f459d7f74406e30af725c751f3b7cd1a6a931a6

Revision history for this message
Nozomi Kawamoto (nkawamot) wrote :

Thank you for your review.

Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :

Thanks, Nozomi for noticing and fixing them. Fixes are valid but as Temepst master needs to support stable/xena branch onwards and try our best to keep the requirement version compatible with upper constraints of stable/xena (the last supported stable branch as of today)

stable/xena has jsonschema 3.2.0 only so let's keep things compatible with 3.2.0 unless they start failing https://github.com/openstack/requirements/blob/stable/xena/upper-constraints.txt#L548

Revision history for this message
Nozomi Kawamoto (nkawamot) wrote :

Thanks Ghanshyam for taking care of these patches. I understand your point and I missed the backward compatibility. Let's keep the code and ignore the DeprecationWarning at this moment.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tempest 34.1.0

This issue was fixed in the openstack/tempest 34.1.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.