Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] test_http: adapt test to succeed with ubuntu 24.04 noble #165998

Closed

Conversation

d-fence
Copy link
Contributor

@d-fence d-fence commented May 17, 2024

The brand new Ubuntu Noble 24.04 ships python3-werkzeug 3.0.1. This versions has a bug 0 which leads to this test failing as double slashes get fixed by werkzeug even though merge_slashes parameter is set to False by default in Odoo.

This should not have a big impact on real life but the test should be kept to ensure that the actual behavior of a 404 is not broken outside of Ubuntu Noble.

So, with this commit, if the impacted version of werkzeug is used the test will not fail with a fixed url and a redirect response.

The issue that exists from 2.2.0 up to 3.0.1 is fixed upstream 1 in 3.0.2.

A bug report was filled in Ubuntu 2 (Debian is not impacted)

@d-fence d-fence requested a review from Julien00859 May 17, 2024 13:52
@robodoo
Copy link
Contributor

robodoo commented May 17, 2024

Copy link
Member

@Julien00859 Julien00859 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robodoo delegate+

Comment on lines 25 to 28
werkzeug_version = metadata.version('werkzeug')
if parse_version(werkzeug_version) >= parse_version('2.0.2') and parse_version(werkzeug_version) <= parse_version('3.0.1'):
# Bug in werkzeug from 2.2.0 up to 3.0.1 (shipped in Ubuntu Noble 24.04)
# Not a really big deal but should be remvoved once fixed upstream
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
werkzeug_version = metadata.version('werkzeug')
if parse_version(werkzeug_version) >= parse_version('2.0.2') and parse_version(werkzeug_version) <= parse_version('3.0.1'):
# Bug in werkzeug from 2.2.0 up to 3.0.1 (shipped in Ubuntu Noble 24.04)
# Not a really big deal but should be remvoved once fixed upstream
werkzeug_version = metadata.version('werkzeug')
if parse_version('2.0.2') <= parse_version(werkzeug_version) <= parse_version('3.0.1'):
# Bug in werkzeug from 2.2.0 up to 3.0.1 (shipped in Ubuntu Noble 24.04)
# not a big deal but should be removed once fixed upstream.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also change parse_version('2.0.2')

@d-fence d-fence force-pushed the 16.0-remove-test-misc-redirect-moc branch from c681ee9 to 81261cd Compare May 17, 2024 13:59
@C3POdoo C3POdoo added the RD research & development, internal work label May 17, 2024
Copy link
Member

@Julien00859 Julien00859 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

importlib.metadata is 3.8 but odoo16 must support 3.7

@C3POdoo C3POdoo requested a review from a team May 17, 2024 14:09
The brand new Ubuntu Noble 24.04 ships python3-werkzeug 3.0.1.
This versions has a bug [0] which leads to this test failing as double
slashes get fixed by werkzeug even though `merge_slashes` parameter is
set to False by default in Odoo.

This should not have a big impact on real life but the test should be
kept to ensure that the actual behavior of a 404 is not broken outside
of Ubuntu Noble.

So, with this commit, if the impacted version of werkzeug is used the
test will not fail with a fixed url and a redirect response.

The issue that exists from 2.2.0 up to 3.0.1 is fixed upstream [1] in
3.0.2.

A bug report was filled in Ubuntu [2] (Debian is not impacted)

[0]: pallets/werkzeug#2834
[1]: pallets/werkzeug#2860
[2]: https://bugs.launchpad.net/ubuntu/+source/python-werkzeug/+bug/2066041
@d-fence d-fence force-pushed the 16.0-remove-test-misc-redirect-moc branch from 81261cd to 27124a9 Compare May 17, 2024 14:43
@d-fence
Copy link
Contributor Author

d-fence commented May 17, 2024

importlib.metadata is 3.8 but odoo16 must support 3.7

Nice catch (unlike parse_version('2.0.2') which was not really your catch)

Copy link
Member

@Julien00859 Julien00859 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

robodoo pushed a commit that referenced this pull request May 17, 2024
The brand new Ubuntu Noble 24.04 ships python3-werkzeug 3.0.1.
This versions has a bug [0] which leads to this test failing as double
slashes get fixed by werkzeug even though `merge_slashes` parameter is
set to False by default in Odoo.

This should not have a big impact on real life but the test should be
kept to ensure that the actual behavior of a 404 is not broken outside
of Ubuntu Noble.

So, with this commit, if the impacted version of werkzeug is used the
test will not fail with a fixed url and a redirect response.

The issue that exists from 2.2.0 up to 3.0.1 is fixed upstream [1] in
3.0.2.

A bug report was filled in Ubuntu [2] (Debian is not impacted)

[0]: pallets/werkzeug#2834
[1]: pallets/werkzeug#2860
[2]: https://bugs.launchpad.net/ubuntu/+source/python-werkzeug/+bug/2066041

closes #165998

Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
@robodoo robodoo closed this May 17, 2024
@fw-bot fw-bot deleted the 16.0-remove-test-misc-redirect-moc branch May 31, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants