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

chore(product-assistant): speed up evaluation tests v2 #27062

Merged
merged 8 commits into from
Dec 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions ee/hogai/eval/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import functools
from collections.abc import Generator
from pathlib import Path

import pytest
from django.conf import settings
Expand Down Expand Up @@ -36,12 +37,14 @@ def wrapper(*args, **kwargs):

# Apply decorators to all tests in the package.
def pytest_collection_modifyitems(items):
current_dir = Path(__file__).parent
for item in items:
item.add_marker(
pytest.mark.skipif(not settings.IN_EVAL_TESTING, reason="Only runs for the assistant evaluation")
)
# Apply our custom retry decorator to the test function
item.obj = retry_test_only(max_retries=3)(item.obj)
if Path(item.fspath).is_relative_to(current_dir):
Copy link
Member

Choose a reason for hiding this comment

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

Damn, yeah, I even checked pytest docs to make sure this only applies to this directory:
Screenshot 2024-12-19 at 18 23 49
and that put me at ease so much I didn't bother checking if non-eval tests will still run 🙈

item.add_marker(
pytest.mark.skipif(not settings.IN_EVAL_TESTING, reason="Only runs for the assistant evaluation")
)
# Apply our custom retry decorator to the test function
item.obj = retry_test_only(max_retries=3)(item.obj)


@pytest.fixture(scope="package")
Expand Down
Loading