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

test: Fix telemetry tests so they don't fail #7708

Merged
merged 3 commits into from
May 23, 2024
Merged

Conversation

silvanocerza
Copy link
Contributor

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/python@3.12/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/python@3.12/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/python@3.12/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

@silvanocerza silvanocerza added the ignore-for-release-notes PRs with this flag won't be included in the release notes. label May 16, 2024
@silvanocerza silvanocerza requested a review from masci May 16, 2024 20:58
@silvanocerza silvanocerza self-assigned this May 16, 2024
@silvanocerza silvanocerza requested a review from a team as a code owner May 16, 2024 20:58
@silvanocerza silvanocerza requested review from anakin87 and removed request for a team and anakin87 May 16, 2024 20:58
Copy link
Member

@masci masci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 9210876904

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 17 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.005%) to 90.548%

Files with Coverage Reduction New Missed Lines %
components/generators/azure.py 3 92.31%
components/generators/chat/azure.py 3 92.11%
tracing/tracer.py 3 91.95%
components/readers/extractive.py 8 95.67%
Totals Coverage Status
Change from base Build 9176174231: -0.005%
Covered Lines: 6610
Relevant Lines: 7300

💛 - Coveralls

@silvanocerza silvanocerza merged commit 4bc6285 into main May 23, 2024
21 checks passed
@silvanocerza silvanocerza deleted the fix-telemetry-test branch May 23, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-for-release-notes PRs with this flag won't be included in the release notes. topic:tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants