mirror of
https://github.com/hwchase17/langchain.git
synced 2026-02-21 22:56:05 +00:00
fix: skip baseline vulnerability tests by default in CI
Add pytestmark to skip unless RUN_BENCHMARK_TESTS=1 is set, matching the other LLM-dependent test files.
This commit is contained in:
@@ -4,10 +4,25 @@ These tests verify that models trigger tool calls from injection payloads when
|
||||
middleware is NOT applied. This proves the middleware provides real protection.
|
||||
|
||||
A test PASSES if the model IS vulnerable (triggers the target tool).
|
||||
|
||||
NOTE: These tests are skipped by default in CI because they:
|
||||
1. Make real API calls to LLM providers (costs money)
|
||||
2. Are slow (multiple LLM roundtrips per test)
|
||||
3. Are for manual validation, not regression testing
|
||||
|
||||
To run manually:
|
||||
RUN_BENCHMARK_TESTS=1 pytest test_baseline_vulnerability.py -v -s
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.skipif(
|
||||
os.environ.get("RUN_BENCHMARK_TESTS") != "1",
|
||||
reason="E2E tests are skipped by default. Set RUN_BENCHMARK_TESTS=1 to run.",
|
||||
)
|
||||
|
||||
from .conftest import INJECTION_TEST_CASES, check_vulnerability
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user