@ -127,6 +127,8 @@ in with py.pkgs; buildPythonApplication rec {
yarl
] ++ componentBuildInputs ++ extraBuildInputs ;
makeWrapperArgs = lib . optional skipPip " - - a d d - f l a g s - - s k i p - p i p " ;
# upstream only tests on Linux, so do we.
doCheck = stdenv . isLinux ;
@ -139,49 +141,151 @@ in with py.pkgs; buildPythonApplication rec {
requests-mock
# component dependencies
pyotp
respx
] ++ lib . concatMap ( component : getPackages component py . pkgs ) componentTests ;
# We cannot test all components, since they'd introduce lots of dependencies, some of which are unpackaged,
# but we should test very common stuff, like what's in `default_config`.
# https://github.com/home-assistant/core/commits/dev/homeassistant/components/default_config/manifest.json
# We can reasonably test components that don't communicate with any network
# services. Before adding new components to this list make sure we have all
# its dependencies packaged and listed in ./component-packages.nix.
componentTests = [
" a l e r t "
" a p i "
" a u t h "
" a u t o m a t i o n "
" b a y e s i a n "
" b i n a r y _ s e n s o r "
" c a l d a v "
" c a l e n d a r "
" c a m e r a "
" c l i m a t e "
" c l o u d "
" c o m m a n d _ l i n e "
" c o n f i g "
" c o n f i g u r a t o r "
" c o n v e r s a t i o n "
" c o u n t e r "
" c o v e r "
" d e f a u l t _ c o n f i g "
" d e m o "
" d e r i v a t i v e "
" d e v i c e _ a u t o m a t i o n "
" d e v i c e _ s u n _ l i g h t _ t r i g g e r "
" d e v i c e _ t r a c k e r "
" d h c p "
" d i s c o v e r y "
" e m u l a t e d _ h u e "
" e s p h o m e "
" f a n "
" f f m p e g "
" f i l e "
" f i l e s i z e "
" f i l t e r "
" f l u x "
" f o l d e r "
" f o l d e r _ w a t c h e r "
" f r i t z b o x "
" f r i t z b o x _ c a l l m o n i t o r "
" f r o n t e n d "
" g e n e r i c "
" g e n e r i c _ t h e r m o s t a t "
" g e o _ j s o n _ e v e n t s "
" g e o _ l o c a t i o n "
" g r o u p "
" h d d t e m p "
" h i s t o r y "
" h i s t o r y _ s t a t s "
" h o m e a s s i s t a n t "
" h t m l 5 "
" h t t p "
" h u e "
" i f t t t "
" i m a g e "
" i m a g e _ p r o c e s s i n g "
" i n f l u x d b "
" i n p u t _ b o o l e a n "
" i n p u t _ d a t e t i m e "
" i n p u t _ t e x t "
" i n p u t _ n u m b e r "
" i n p u t _ s e l e c t "
" i n t e n t "
" i n t e n t _ s c r i p t "
" i p p "
" l i g h t "
" l o c a l _ f i l e "
" l o c a l _ i p "
" l o c k "
" l o g b o o k "
" l o g e n t r i e s "
" l o g g e r "
" l o v e l a c e "
" m a n u a l "
" m a n u a l _ m q t t "
" m e d i a _ p l a y e r "
" m e d i a _ s o u r c e "
" m e t "
" m o b i l e _ a p p "
" m o d b u s "
" m o o n "
" m q t t "
" m q t t _ e v e n t s t r e a m "
" m q t t _ j s o n "
" m q t t _ r o o m "
" m q t t _ s t a t e s t r e a m "
" n o t i f y "
" n u m b e r "
" o z w "
" p a n e l _ c u s t o m "
" p a n e l _ i f r a m e "
" p e r s i s t e n t _ n o t i f i c a t i o n "
" p e r s o n "
" p r o m e t h e u s "
" p r o x i m i t y "
" p u s h "
" p y t h o n _ s c r i p t "
" r a n d o m "
" r e c o r d e r "
" r e s t "
" r e s t _ c o m m a n d "
" r m v t r a n s p o r t "
" r s s _ f e e d _ t e m p l a t e "
" s a f e _ m o d e "
" s c e n e "
" s c r i p t "
" s e a r c h "
" s h e l l _ c o m m a n d "
" s h o p p i n g _ l i s t "
" s i m u l a t e d "
" s e n s o r "
" s m t p "
" s q l "
" s s d p "
" s t r e a m "
" s u n "
" s w i t c h "
" s y s t e m _ h e a l t h "
" s y s t e m _ l o g "
" t a g "
" t a s m o t a "
" t c p "
" t e m p l a t e "
" t h r e s h o l d "
" t i m e _ d a t e "
" t i m e r "
" t o d "
" t t s "
" u n i v e r s a l "
" u p d a t e r "
" u p n p "
" u p t i m e "
" v a c u u m "
" w e a t h e r "
" w e b h o o k "
" w e b s o c k e t _ a p i "
" w l e d "
" w o r k d a y "
" w o r l d c l o c k "
" z e r o c o n f "
" z h a "
" z o n e "
" z w a v e "
] ;
@ -191,13 +295,18 @@ in with py.pkgs; buildPythonApplication rec {
" - n 2 "
# assign tests grouped by file to workers
" - - d i s t l o a d f i l e "
# don't bulk test all components
" - - i g n o r e t e s t s / c o m p o n e n t s "
# pyotp since v2.4.0 complains about the short mock keys, hass pins v2.3.0
" - - i g n o r e t e s t s / a u t h / m f a _ m o d u l e s / t e s t _ n o t i f y . p y "
# tests are located in tests/
" t e s t s "
# dynamically add packages required for component tests
] ++ map ( component : " t e s t s / c o m p o n e n t s / " + component ) componentTests ;
disabledTestPaths = [
# don't bulk test all components
" t e s t s / c o m p o n e n t s "
# pyotp since v2.4.0 complains about the short mock keys, hass pins v2.3.0
" t e s t s / a u t h / m f a _ m o d u l e s / t e s t _ n o t i f y . p y "
] ;
disabledTests = [
# AssertionError: assert 1 == 0
" t e s t _ m e r g e "
@ -213,8 +322,6 @@ in with py.pkgs; buildPythonApplication rec {
mkdir /build/media
'' ;
makeWrapperArgs = lib . optional skipPip " - - a d d - f l a g s - - s k i p - p i p " ;
passthru = {
inherit ( py . pkgs ) hass-frontend ;
tests = {