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

Upgrade to mocket-3.9.x or mocket-3.10.x vs. Python 3.11 #116

Merged
merged 5 commits into from
Dec 3, 2022
Merged

Conversation

amotl
Copy link
Member

@amotl amotl commented Nov 26, 2022

Hi there,

this patch attempts to upgrade to mocket-3.9.x or mocket-3.10.x.

Currently, it croaks, because http-parser is not ready for Python 3.11 yet:

Using mocket-3.10.x is not an option yet, as it apparently has a different issue:

With kind regards,
Andreas.

@codecov
Copy link

codecov bot commented Nov 26, 2022

Codecov Report

Merging #116 (792ebc8) into main (9b67b3c) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #116   +/-   ##
=======================================
  Coverage   46.39%   46.39%           
=======================================
  Files          57       57           
  Lines        4854     4854           
=======================================
  Hits         2252     2252           
  Misses       2602     2602           
Flag Coverage Δ
unittests 46.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@amotl amotl changed the title Upgrade mocket vs. Python 3.11 Upgrade mocket-3.9.x vs. Python 3.11 Nov 26, 2022
@amotl amotl changed the title Upgrade mocket-3.9.x vs. Python 3.11 Upgrade to mocket-3.9.x vs. Python 3.11 Nov 26, 2022
@amotl amotl changed the title Upgrade to mocket-3.9.x vs. Python 3.11 Upgrade to mocket-3.9.x or mocket-3.10.x vs. Python 3.11 Dec 3, 2022
amotl added 2 commits December 4, 2022 00:22
Apparently, something in here is not cleared up properly, so some
misconfiguration leaks into the other test cases, and makes them break.
@amotl
Copy link
Member Author

amotl commented Dec 3, 2022

@mindflayer was quick to submit a fix at mindflayer/python-mocket#192. Thank you so much! Indeed, pytest --no-cov test/test_lorawan.py now works with Mocket 3.10.9 - excellent!

However, in the context of this PR, or when all tests are being invoked (just run pytest), we are observing:

Traceback (most recent call last):
  File "/path/to/terkin-datalogger/.venv310/lib/python3.10/site-packages/mocket/mocket.py", line 349, in true_sendall
    encoded_response = hexload(response_dict["response"])
KeyError: 'response'

-- https://github.com/hiveeyes/terkin-datalogger/actions/runs/3610611746/jobs/6084514008#step:7:3427

Because @mindflayer told us about our unconventional usage of Mocket already, we should probably go back to the drawing board.

@amotl
Copy link
Member Author

amotl commented Dec 3, 2022

It's our fault, as always. It looks like some other test cases leaked misconfigured resources, so we disabled them with a91ba3e.

Currently, because of `http-parser` not supporting it, Mocket is not
ready for Python 3.11 yet. However, older versions work.
@amotl
Copy link
Member Author

amotl commented Dec 3, 2022

792ebc8 is our solution to make it work on Python 3.11. Apologies.

@amotl amotl marked this pull request as ready for review December 3, 2022 23:35
@amotl amotl merged commit ffcffba into main Dec 3, 2022
@amotl amotl deleted the upgrade-mocket branch December 3, 2022 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant