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

python3Packages.fritzconnection: 1.4.2 -> 1.5.0 #121434

Merged
merged 2 commits into from
May 7, 2021

Conversation

dotlambda
Copy link
Member

Motivation for this change

https://fritzconnection.readthedocs.io/en/1.5.0/sources/changes.html

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

The tests for the fritz component only exist in the upcoming version of Home Assistant.

@mweinelt
Copy link
Member

mweinelt commented May 4, 2021

fritzconnection bump LGTM.

@mweinelt
Copy link
Member

mweinelt commented May 6, 2021

Please rebase and make sure the tests are working.

@dotlambda
Copy link
Member Author

Seems like the tests fail :/

@ofborg ofborg bot added the 11.by: package-maintainer This PR was created by the maintainer of the package it changes label May 6, 2021
@dotlambda
Copy link
Member Author

Now tests/components/mobile_app/test_webhook.py::test_webhook_handle_get_config[pyloop] fails, but that seems unrelated.

@mweinelt
Copy link
Member

mweinelt commented May 7, 2021

What were the home-assistant test issues with the fritz component? Something fixable, reportable, etc.?

@dotlambda
Copy link
Member Author

What were the home-assistant test issues with the fritz component? Something fixable, reportable, etc.?

The error messages weren't telling at all. Something about pytest-rerun but some file was still open.

@mweinelt
Copy link
Member

mweinelt commented May 7, 2021

Rough, seems like tests/components/fritz/test_config_flow.py::test_user and others breaks the pytest-xdist/rerunfailures contraption we've got in place.

INTERNALERROR> def worker_internal_error(self, node, formatted_error):
INTERNALERROR>         """
INTERNALERROR>         pytest_internalerror() was called on the worker.
INTERNALERROR>
INTERNALERROR>         pytest_internalerror() arguments are an excinfo and an excrepr, which can't
INTERNALERROR>         be serialized, so we go with a poor man's solution of raising an exception
INTERNALERROR>         here ourselves using the formatted message.
INTERNALERROR>         """
INTERNALERROR>         self._active_nodes.remove(node)
INTERNALERROR>         try:
INTERNALERROR> >           assert False, formatted_error
INTERNALERROR> E           AssertionError: Traceback (most recent call last):
INTERNALERROR> E               File "/nix/store/jmzx9dsqb96865swyvs0ib9g5dz2qdwg-python3.8-pytest-6.2.3/lib/python3.8/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR> E                 session.exitstatus = doit(config, session) or 0
INTERNALERROR> E               File "/nix/store/jmzx9dsqb96865swyvs0ib9g5dz2qdwg-python3.8-pytest-6.2.3/lib/python3.8/site-packages/_pytest/main.py", line 323, in _main
INTERNALERROR> E                 config.hook.pytest_runtestloop(session=session)
INTERNALERROR> E               File "/nix/store/4x8s35vrcq53azwp05p2bcbf5k6ryxr8-python3.8-pluggy-0.13.1/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR> E                 return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> E               File "/nix/store/4x8s35vrcq53azwp05p2bcbf5k6ryxr8-python3.8-pluggy-0.13.1/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR> E                 return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> E               File "/nix/store/4x8s35vrcq53azwp05p2bcbf5k6ryxr8-python3.8-pluggy-0.13.1/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
INTERNALERROR> E                 self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR> E               File "/nix/store/4x8s35vrcq53azwp05p2bcbf5k6ryxr8-python3.8-pluggy-0.13.1/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> E                 return outcome.get_result()
INTERNALERROR> E               File "/nix/store/4x8s35vrcq53azwp05p2bcbf5k6ryxr8-python3.8-pluggy-0.13.1/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> E                 raise ex[1].with_traceback(ex[2])
INTERNALERROR> E               File "/nix/store/4x8s35vrcq53azwp05p2bcbf5k6ryxr8-python3.8-pluggy-0.13.1/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> E                 res = hook_impl.function(*args)
INTERNALERROR> E               File "/nix/store/ar1xc6jypbhj1r1vh2378iya1aq0siia-python3.8-pytest-xdist-2.2.1/lib/python3.8/site-packages/xdist/remote.py", line 72, in pytest_runtestloop
INTERNALERROR> E                 self.run_one_test(torun)
INTERNALERROR> E               File "/nix/store/ar1xc6jypbhj1r1vh2378iya1aq0siia-python3.8-pytest-xdist-2.2.1/lib/python3.8/site-packages/xdist/remote.py", line 89, in run_one_test
INTERNALERROR> E                 self.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR> E               File "/nix/store/4x8s35vrcq53azwp05p2bcbf5k6ryxr8-python3.8-pluggy-0.13.1/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR> E                 return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> E               File "/nix/store/4x8s35vrcq53azwp05p2bcbf5k6ryxr8-python3.8-pluggy-0.13.1/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR> E                 return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> E               File "/nix/store/4x8s35vrcq53azwp05p2bcbf5k6ryxr8-python3.8-pluggy-0.13.1/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
INTERNALERROR> E                 self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR> E               File "/nix/store/4x8s35vrcq53azwp05p2bcbf5k6ryxr8-python3.8-pluggy-0.13.1/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> E                 return outcome.get_result()
INTERNALERROR> E               File "/nix/store/4x8s35vrcq53azwp05p2bcbf5k6ryxr8-python3.8-pluggy-0.13.1/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> E                 raise ex[1].with_traceback(ex[2])
INTERNALERROR> E               File "/nix/store/4x8s35vrcq53azwp05p2bcbf5k6ryxr8-python3.8-pluggy-0.13.1/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> E                 res = hook_impl.function(*args)
INTERNALERROR> E               File "/nix/store/df4g7jcxd1vkxsrjh9dxkiggw98287z8-python3.8-pytest-rerunfailures-9.1.1/lib/python3.8/site-packages/pytest_rerunfailures.py", line 243, in pytest_runtest_protocol
INTERNALERROR> E                 is_terminal_error = _should_hard_fail_on_error(item.session.config, report)
INTERNALERROR> E               File "/nix/store/df4g7jcxd1vkxsrjh9dxkiggw98287z8-python3.8-pytest-rerunfailures-9.1.1/lib/python3.8/site-packages/pytest_rerunfailures.py", line 211, in _should_hard_fail_on_error
INTERNALERROR> E                 if re.search(rerun_regex, report.longrepr.reprcrash.message):
INTERNALERROR> E             AttributeError: 'FixtureLookupErrorRepr' object has no attribute 'reprcrash'
INTERNALERROR> E           assert False
INTERNALERROR>
INTERNALERROR> /nix/store/ar1xc6jypbhj1r1vh2378iya1aq0siia-python3.8-pytest-xdist-2.2.1/lib/python3.8/site-packages/xdist/dsession.py:187: AssertionError
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/nix/store/jmzx9dsqb96865swyvs0ib9g5dz2qdwg-python3.8-pytest-6.2.3/lib/python3.8/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/nix/store/jmzx9dsqb96865swyvs0ib9g5dz2qdwg-python3.8-pytest-6.2.3/lib/python3.8/site-packages/_pytest/main.py", line 323, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/nix/store/4x8s35vrcq53azwp05p2bcbf5k6ryxr8-python3.8-pluggy-0.13.1/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/nix/store/4x8s35vrcq53azwp05p2bcbf5k6ryxr8-python3.8-pluggy-0.13.1/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/nix/store/4x8s35vrcq53azwp05p2bcbf5k6ryxr8-python3.8-pluggy-0.13.1/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR>   File "/nix/store/4x8s35vrcq53azwp05p2bcbf5k6ryxr8-python3.8-pluggy-0.13.1/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/nix/store/4x8s35vrcq53azwp05p2bcbf5k6ryxr8-python3.8-pluggy-0.13.1/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/nix/store/4x8s35vrcq53azwp05p2bcbf5k6ryxr8-python3.8-pluggy-0.13.1/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/nix/store/ar1xc6jypbhj1r1vh2378iya1aq0siia-python3.8-pytest-xdist-2.2.1/lib/python3.8/site-packages/xdist/dsession.py", line 112, in pytest_runtestloop
INTERNALERROR>     self.loop_once()
INTERNALERROR>   File "/nix/store/ar1xc6jypbhj1r1vh2378iya1aq0siia-python3.8-pytest-xdist-2.2.1/lib/python3.8/site-packages/xdist/dsession.py", line 135, in loop_once
INTERNALERROR>     call(**kwargs)
INTERNALERROR>   File "/nix/store/ar1xc6jypbhj1r1vh2378iya1aq0siia-python3.8-pytest-xdist-2.2.1/lib/python3.8/site-packages/xdist/dsession.py", line 174, in worker_workerfinished
INTERNALERROR>     assert not crashitem, (crashitem, node)
INTERNALERROR> AssertionError: ('tests/components/fritz/test_config_flow.py::test_reauth_successful[pyloop]', <WorkerController gw1>)
INTERNALERROR> assert not 'tests/components/fritz/test_config_flow.py::test_reauth_successful[pyloop]'

Trying to untangle that mess. It always helps to disable xdist when things fail in weird ways.

tests/components/fritz/test_config_flow.py::test_exception_security[pyloop] PASSED [ 33%]
tests/components/fritz/test_config_flow.py::test_exception_connection[pyloop] PASSED [ 33%]
tests/components/fritz/test_config_flow.py::test_exception_unknown[pyloop] PASSED [ 33%]
tests/components/fritz/test_config_flow.py::test_reauth_successful[pyloop] ERROR [ 33%]
tests/components/fritz/test_config_flow.py::test_reauth_not_successful[pyloop] ERROR [ 33%]
tests/components/fritz/test_config_flow.py::test_ssdp_already_configured[pyloop] ERROR [ 33%]
tests/components/fritz/test_config_flow.py::test_ssdp_already_configured_host[pyloop] ERROR [ 33%]
tests/components/fritz/test_config_flow.py::test_ssdp_already_configured_host_uuid[pyloop] ERROR [ 33%]
tests/components/fritz/test_config_flow.py::test_ssdp_already_in_progress_host[pyloop] ERROR [ 33%]
tests/components/fritz/test_config_flow.py::test_ssdp[pyloop] ERROR      [ 33%]
tests/components/fritz/test_config_flow.py::test_ssdp_exception[pyloop] PASSED [ 33%]
tests/components/fritz/test_config_flow.py::test_import[pyloop] ERROR    [ 33%]

@mweinelt
Copy link
Member

mweinelt commented May 7, 2021

  @pytest.fixture()
  def fc_class_mock(mocker):
E       fixture 'mocker' not found
>       available fixtures: aioclient_mock, aiohttp_client, aiohttp_raw_server, aiohttp_server, aiohttp_unused_port, bcrypt_cost, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, current_request, current_request_with_host, doctest_namespace, enable_custom_integrations, fail_on_log_exception, fast, fc_class_mock, hass, hass_access_token, hass_admin_credential, hass_admin_user, hass_client, hass_owner_user, hass_read_only_access_token, hass_read_only_user, hass_storage, hass_ws_client, legacy_auth, legacy_patchable_time, load_registries, local_auth, loop, loop_debug, mock_device_tracker_conf, mock_zeroconf, monkeypatch, mqtt_client_mock, mqtt_config, mqtt_mock, patch_zeroconf_multiple_catcher, prevent_io, proactor_loop, pytestconfig, raw_test_server, record_property, record_testsuite_property, record_xml_attribute, recwarn, requests_mock, stop_hass, test_client, test_server, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unused_port, verify_cleanup, worker_id
>       use 'pytest --fixtures [testpath]' for help on them.

The actual error. Looks fixable.

@mweinelt
Copy link
Member

mweinelt commented May 7, 2021

Works after adding pytest-mock, reported at home-assistant/core#50253.

These tests require pytest-mock for the mocker fixture, but it isn't
declared anywhere.

home-assistant/core#50253
@mweinelt mweinelt marked this pull request as ready for review May 7, 2021 15:25
@ofborg ofborg bot requested a review from mweinelt May 7, 2021 15:33
@dotlambda dotlambda merged commit bf12c87 into NixOS:master May 7, 2021
@dotlambda dotlambda deleted the fritzconnection-1.5.0 branch May 7, 2021 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants