haystack
haystack copied to clipboard
test: Fix telemetry tests so they don't fail
Proposed Changes:
Rewrite some telemetry testing that make pytest to not run.
Technically those tests are not causing failures since they're not technically running at all for pytest. Thought they might cause other plugins to fail.
Example failure:
ImportError:
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/Users/silvanocerza/Library/Application Support/hatch/env/virtual/haystack-ai/ZmvGEzQW/test/lib/python3.12/site-packages/_pytest/main.py", line 285, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/Users/silvanocerza/Library/Application Support/hatch/env/virtual/haystack-ai/ZmvGEzQW/test/lib/python3.12/site-packages/_pytest/main.py", line 339, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "/Users/silvanocerza/Library/Application Support/hatch/env/virtual/haystack-ai/ZmvGEzQW/test/lib/python3.12/site-packages/pluggy/_hooks.py", line 513, in __call__
INTERNALERROR> return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/Users/silvanocerza/Library/Application Support/hatch/env/virtual/haystack-ai/ZmvGEzQW/test/lib/python3.12/site-packages/pluggy/_manager.py", line 120, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/Users/silvanocerza/Library/Application Support/hatch/env/virtual/haystack-ai/ZmvGEzQW/test/lib/python3.12/site-packages/pluggy/_callers.py", line 156, in _multicall
INTERNALERROR> teardown[0].send(outcome)
INTERNALERROR> File "/Users/silvanocerza/Library/Application Support/hatch/env/virtual/haystack-ai/ZmvGEzQW/test/lib/python3.12/site-packages/pytest_cov/plugin.py", line 345, in pytest_runtestloop
INTERNALERROR> from coverage.misc import CoverageException
INTERNALERROR> File "/opt/homebrew/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/unittest/mock.py", line 1134, in __call__
INTERNALERROR> return self._mock_call(*args, **kwargs)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/opt/homebrew/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/unittest/mock.py", line 1138, in _mock_call
INTERNALERROR> return self._execute_mock_call(*args, **kwargs)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/opt/homebrew/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/unittest/mock.py", line 1193, in _execute_mock_call
INTERNALERROR> raise effect
INTERNALERROR> ImportError
How did you test it?
I ran tests locally.
Notes for the reviewer
N/A
Checklist
- I have read the contributors guidelines and the code of conduct
- I have updated the related issue with new insights and changes
- I added unit tests and updated the docstrings
- I've used one of the conventional commit types for my PR title:
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:. - I documented my code
- I ran pre-commit hooks and fixed any issue