2022-01-15 00:20:08 +00:00
{
lib ,
home-assistant ,
} :
let
2024-10-26 00:03:35 +00:00
getComponentDeps = component : home-assistant . getPackages component home-assistant . python . pkgs ;
2022-01-15 00:20:08 +00:00
# some components' tests have additional dependencies
extraCheckInputs = with home-assistant . python . pkgs ; {
2024-10-26 00:03:35 +00:00
axis = getComponentDeps " d e c o n z " ;
2024-11-06 21:52:38 +00:00
gardena_bluetooth = getComponentDeps " h u s q v a r n a _ a u t o m o w e r _ b l e " ;
2024-01-05 20:44:19 +00:00
govee_ble = [
ibeacon-ble
] ;
2024-10-26 00:03:35 +00:00
hassio = getComponentDeps " h o m e a s s i s t a n t _ y e l l o w " ;
2024-11-06 21:52:38 +00:00
husqvarna_automower_ble = getComponentDeps " g a r d e n a _ b l u e t o o t h " ;
2024-01-05 20:44:19 +00:00
lovelace = [
pychromecast
] ;
matrix = [
pydantic
] ;
onboarding = [
pymetno
radios
rpi-bad-power
] ;
raspberry_pi = [
rpi-bad-power
] ;
shelly = [
pyswitchbot
] ;
2024-08-10 21:58:26 +00:00
songpal = [
isal
] ;
2024-08-10 22:00:20 +00:00
system_log = [
isal
] ;
2024-11-06 21:52:38 +00:00
tesla_fleet = getComponentDeps " t e s l e m e t r y " ;
2024-01-05 20:44:19 +00:00
xiaomi_miio = [
arrow
] ;
2024-10-14 23:27:42 +00:00
zeroconf = [
aioshelly
] ;
2024-01-05 20:44:19 +00:00
zha = [
pydeconz
] ;
2022-01-15 00:20:08 +00:00
} ;
extraDisabledTestPaths = {
} ;
2022-03-02 19:25:38 +00:00
extraDisabledTests = {
2023-09-07 11:36:32 +00:00
shell_command = [
# tries to retrieve file from github
" t e s t _ n o n _ t e x t _ s t d o u t _ c a p t u r e "
] ;
2023-11-14 13:42:39 +00:00
sma = [
# missing operating_status attribute in entity
" t e s t _ s e n s o r _ e n t i t i e s "
] ;
2024-05-10 20:31:29 +00:00
websocket_api = [
2024-10-26 00:03:35 +00:00
# AssertionError: assert 'unknown_error' == 'template_error'
2024-05-10 20:31:29 +00:00
" t e s t _ r e n d e r _ t e m p l a t e _ w i t h _ t i m e o u t "
] ;
2022-03-02 19:25:38 +00:00
} ;
2022-01-15 00:20:08 +00:00
extraPytestFlagsArray = {
2024-11-15 20:16:30 +00:00
conversation = [
# Expected: Sorry, I am not aware of any device called missing entity on ground floor
# Actually: Sorry, I am not aware of any area called ground floor
" - - d e s e l e c t t e s t s / c o m p o n e n t s / c o n v e r s a t i o n / t e s t _ d e f a u l t _ a g e n t . p y : : t e s t _ e r r o r _ n o _ d e v i c e _ o n _ f l o o r "
] ;
2022-09-29 00:13:15 +00:00
dnsip = [
2023-04-05 21:30:07 +00:00
# Tries to resolve DNS entries
2022-09-29 00:13:15 +00:00
" - - d e s e l e c t t e s t s / c o m p o n e n t s / d n s i p / t e s t _ c o n f i g _ f l o w . p y : : t e s t _ o p t i o n s _ f l o w "
] ;
2024-11-06 21:52:38 +00:00
honeywell = [
# Failed: Unused ignore translations: component.honeywell.config.abort.reauth_successful. Please remove them from the ignore_translations fixture.
" - - d e s e l e c t = t e s t s / c o m p o n e n t s / h o n e y w e l l / t e s t _ c o n f i g _ f l o w . p y : : t e s t _ r e a u t h _ f l o w "
] ;
2023-08-02 18:55:42 +00:00
jellyfin = [
# AssertionError: assert 'audio/x-flac' == 'audio/flac'
" - - d e s e l e c t t e s t s / c o m p o n e n t s / j e l l y f i n / t e s t _ m e d i a _ s o u r c e . p y : : t e s t _ r e s o l v e "
2024-06-05 20:58:54 +00:00
" - - d e s e l e c t t e s t s / c o m p o n e n t s / j e l l y f i n / t e s t _ m e d i a _ s o u r c e . p y : : t e s t _ a u d i o _ c o d e c _ r e s o l v e "
2023-08-02 18:55:42 +00:00
# AssertionError: assert [+ received] == [- snapshot]
" - - d e s e l e c t t e s t s / c o m p o n e n t s / j e l l y f i n / t e s t _ m e d i a _ s o u r c e . p y : : t e s t _ m u s i c _ l i b r a r y "
] ;
2024-11-06 21:52:38 +00:00
jewish_calendar = [
# Failed: Unused ignore translations: component.jewish_calendar.config.abort.reconfigure_successful. Please remove them from the ignore_translations fixture.
" - - d e s e l e c t t e s t s / c o m p o n e n t s / j e w i s h _ c a l e n d a r / t e s t _ c o n f i g _ f l o w . p y : : t e s t _ r e c o n f i g u r e "
] ;
2022-11-05 01:01:42 +00:00
modem_callerid = [
# aioserial mock produces wrong state
" - - d e s e l e c t t e s t s / c o m p o n e n t s / m o d e m _ c a l l e r i d / t e s t _ i n i t . p y : : t e s t _ s e t u p _ e n t r y "
] ;
2024-11-06 21:52:38 +00:00
nina = [
# Failed: Unused ignore translations: component.nina.options.error.unknown. Please remove them from the ignore_translations fixture.
" - - d e s e l e c t t e s t s / c o m p o n e n t s / n i n a / t e s t _ c o n f i g _ f l o w . p y : : t e s t _ o p t i o n s _ f l o w _ u n e x p e c t e d _ e x c e p t i o n "
] ;
2024-10-26 00:03:35 +00:00
sql = [
" - W "
" i g n o r e : : s q l a l c h e m y . e x c . S A W a r n i n g "
] ;
vicare = [
# Snapshot 'test_all_entities[sensor.model0_electricity_consumption_today-entry]' does not exist!
" - - d e s e l e c t = t e s t s / c o m p o n e n t s / v i c a r e / t e s t _ s e n s o r . p y : : t e s t _ a l l _ e n t i t i e s "
2024-03-07 01:11:45 +00:00
] ;
2022-01-15 00:20:08 +00:00
} ;
in
lib . listToAttrs (
map (
component :
lib . nameValuePair component (
home-assistant . overridePythonAttrs ( old : {
pname = " h o m e a s s i s t a n t - t e s t - ${ component } " ;
2024-06-05 20:58:54 +00:00
pyproject = null ;
2022-09-17 13:08:56 +00:00
format = " o t h e r " ;
2022-01-15 00:20:08 +00:00
dontBuild = true ;
dontInstall = true ;
2023-01-21 12:00:00 +00:00
nativeCheckInputs =
old . nativeCheckInputs
2022-01-15 00:20:08 +00:00
++ home-assistant . getPackages component home-assistant . python . pkgs
++ extraCheckInputs . ${ component } or [ ] ;
2023-02-03 14:49:42 +00:00
disabledTests = old . disabledTests or [ ] ++ extraDisabledTests . ${ component } or [ ] ;
disabledTestPaths = old . disabledTestPaths or [ ] ++ extraDisabledTestPaths . ${ component } or [ ] ;
2022-01-15 00:20:08 +00:00
2022-04-14 00:54:53 +00:00
# components are more often racy than the core
dontUsePytestXdist = true ;
2022-01-15 00:20:08 +00:00
pytestFlagsArray =
lib . remove " t e s t s " old . pytestFlagsArray
++ extraPytestFlagsArray . ${ component } or [ ]
++ [ " t e s t s / c o m p o n e n t s / ${ component } " ] ;
2022-02-02 20:53:50 +00:00
preCheck =
old . preCheck
+
lib . optionalString
( builtins . elem component [
" e m u l a t e d _ h u e "
" s o n g p a l "
" s y s t e m _ l o g "
] )
''
2022-01-15 00:20:08 +00:00
patch - p1 < $ { ./patches/tests-mock-source-ip.patch }
'' ;
meta = old . meta // {
2024-07-21 10:07:23 +00:00
broken = lib . elem component [ ] ;
2022-01-15 00:20:08 +00:00
# upstream only tests on Linux, so do we.
platforms = lib . platforms . linux ;
} ;
} )
)
) home-assistant . supportedComponentsWithTests
2024-12-10 19:26:33 +00:00
)