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

home-assistant: enable alot more component tests #123456

Merged
merged 6 commits into from May 19, 2021

Conversation

mweinelt
Copy link
Member

Motivation for this change

Enable tests for all components we have packaged up, when they exist.

Update pyflume to 0.7.0 to get rid of pyjwt<2.0 pin.

Update component-packages to include pygatt dependency.

Since the majority of tests that aren't working are network related (Trying to send out packets, trying to join multicast groups, ...) I'm going to propose a network marker on those tests upstream.

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.

@vcunat
Copy link
Member

vcunat commented May 18, 2021

You guessed my password!

The following test failure occurs with 4.2.1, due to `network` not being
allowed to be None after pylast/pylast@6fe9aa6.

_________________________ test_update_playing[pyloop] __________________________
[gw20] linux -- Python 3.8.9 /nix/store/hq6mrm0pc6xn6j8y6lm4qcgg9rwmqd8q-python3-3.8.9/bin/python3.8

hass = <homeassistant.core.HomeAssistant object at 0x7ffdcba15700>
lastfm_network = <MagicMock name='LastFMNetwork' id='140728019800752'>

    async def test_update_playing(hass, lastfm_network):
        """Test update when song playing."""

        lastfm_network.return_value.get_user.return_value = MockUser(
>           Track("artist", "title", None)
        )

hass       = <homeassistant.core.HomeAssistant object at 0x7ffdcba15700>
lastfm_network = <MagicMock name='LastFMNetwork' id='140728019800752'>

tests/components/lastfm/test_sensor.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nix/store/f0ci60zk59rz5767l9lfy7q767zna6j5-python3.8-pylast-4.2.1/lib/python3.8/site-packages/pylast/__init__.py:2095: in __init__
    super().__init__(artist, title, network, "track", username, info)
        __class__  = <class 'pylast.Track'>
        artist     = 'artist'
        info       = None
        network    = None
        self       = pylast.Track('artist', 'title', None)
        title      = 'title'
        username   = None
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = pylast.Track('artist', 'title', None), artist = 'artist', title = 'title'
network = None, ws_prefix = 'track', username = None, info = {}

    def __init__(self, artist, title, network, ws_prefix, username=None, info=None):
        """
        Create an opus instance.
        # Parameters:
            * artist: An artist name or an Artist object.
            * title: The album or track title.
            * ws_prefix: 'album' or 'track'
        """

        if info is None:
            info = {}

        super().__init__(network=network, ws_prefix=ws_prefix)

        if isinstance(artist, Artist):
            self.artist = artist
        else:
            self.artist = Artist(artist, self.network)

        self.title = title
        self.username = (
>           username if username else network.username
        )  # Default to current user
E       AttributeError: 'NoneType' object has no attribute 'username'

__class__  = <class 'pylast._Opus'>
artist     = 'artist'
info       = {}
network    = None
self       = pylast.Track('artist', 'title', None)
title      = 'title'
username   = None
ws_prefix  = 'track'

/nix/store/f0ci60zk59rz5767l9lfy7q767zna6j5-python3.8-pylast-4.2.1/lib/python3.8/site-packages/pylast/__init__.py:1520: AttributeError
@mweinelt mweinelt merged commit eaf59b9 into NixOS:master May 19, 2021
@mweinelt mweinelt deleted the home-assistant-tests branch May 19, 2021 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants