Closed strawgate closed 1 month ago
I tried really hard to update the existing parametrized update method tests and gave up and just split out the tests.
Kibana will show millisecond due to limitations in Kibana
But searching the documents shows nanosecond
Coverage Report
File Stmts Miss Cover Missing __init__.py 0 0 100% elasticsearch __init__.py 90 2 97% 208–209 config_flow.py 250 28 88% 83, 122, 230, 300, 323, 337, 378–381, 383–384, 386, 388–390, 392–393, 407–408, 412, 452, 458, 498, 573, 582, 616–617 const.py 33 0 100% entity_details.py 33 0 100% errors.py 28 3 89% 51, 60, 67 es_doc_creator.py 181 0 100% es_doc_publisher.py 249 15 93% 101, 243–244, 260–261, 353, 443–444, 446–447, 449–453 es_gateway.py 100 20 80% 82–83, 98, 102, 118–120, 122, 124–125, 127–131, 133–137 es_index_manager.py 121 8 93% 228–229, 246–247, 252–253, 282–283 es_integration.py 37 2 94% 43–44 es_privilege_check.py 55 0 100% es_serializer.py 10 1 90% 17 es_version.py 30 0 100% logger.py 2 0 100% system_info.py 17 1 94% 23 utils.py 4 0 100% TOTAL 1240 80 93%
Tests | Skipped | Failures | Errors | Time |
---|---|---|---|---|
95 | 0 :zzz: | 0 :x: | 0 :fire: | 6.461s :stopwatch: |
At some point I'll probably take a stab at refactoring the doc_publisher tests...
Add event.action, event.type, event.kind, log duplicate documents, and move datetimes to nanosecond precision.
Note: If testing against an existing Elasticsearch instance you will not see nanosecond datetimes until the data streams rollover as index template changes don't take effect on existing indices. You can manually invoke rollover via:
POST metrics-homeassistant.*/_rollover
Fixes: #260 Maybe fixes: #261