diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7f5c07cbb..7a6690c21 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -84,7 +84,8 @@ jobs: $DURATIONS_ARG \ --durations=10 \ -n auto \ - --maxfail=3 + --maxfail=3 \ + -m "not requires_local_services" - name: Save uv caches if: steps.cache-restore.outputs.cache-hit != 'true' diff --git a/pyproject.toml b/pyproject.toml index aa045182e..325b60ebb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -156,6 +156,7 @@ exclude_dirs = ["src/crewai/cli/templates"] [tool.pytest.ini_options] markers = [ "telemetry: mark test as a telemetry test (don't mock telemetry)", + "requires_local_services: mark test as requiring local services like Ollama (skip in CI)", ] [[tool.uv.index]] diff --git a/tests/conftest.py b/tests/conftest.py index b84950a3a..072e57198 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -162,11 +162,12 @@ def mock_opentelemetry_components(): @pytest.fixture(scope="module") def vcr_config(request) -> dict: import os - # In CI, use once mode to fail if cassette doesn't exist + # In CI, use none mode to never record new requests # Locally, use new_episodes to record new cassettes - record_mode = "once" if os.getenv("CI") else "new_episodes" + record_mode = "none" if os.getenv("CI") else "new_episodes" return { "cassette_library_dir": "tests/cassettes", "record_mode": record_mode, "filter_headers": [("authorization", "AUTHORIZATION-XXX")], + "match_on": ["method", "scheme", "host", "port", "path", "query"], }