Skip to content

Commit 5056608

Browse files
committed
fix(ci): resolve JSCPD duplicate and spell-check failures
- Consolidate two near-identical conftest files into tests/conftest.py to fix JSCPD copy-paste detection failure - Add ASSRF, canonname, gaierror, IMDS, INJ, sockaddr to spell-check allow list (all come from our url_validation.py patch)
1 parent 4dbb24e commit 5056608

4 files changed

Lines changed: 23 additions & 49 deletions

File tree

.github/actions/spelling/allow.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,9 @@ Tful
9494
tiangolo
9595
typeerror
9696
vulnz
97+
ASSRF
98+
canonname
99+
gaierror
100+
IMDS
101+
INJ
102+
sockaddr

tests/client/conftest.py

Lines changed: 0 additions & 24 deletions
This file was deleted.

tests/conftest.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import pytest
2+
from unittest.mock import patch
3+
4+
5+
@pytest.fixture(autouse=True)
6+
def bypass_ssrf_url_validation(request):
7+
"""Bypass DNS-based SSRF validation for all tests except test_url_validation.
8+
9+
Most tests use synthetic hostnames (localhost, testserver, example.com)
10+
that either resolve to loopback or are unavailable in CI. The actual SSRF
11+
validation logic is tested in tests/utils/test_url_validation.py.
12+
"""
13+
if "test_url_validation" in request.node.nodeid:
14+
yield
15+
else:
16+
with patch("a2a.client.card_resolver.validate_agent_card_url"):
17+
yield

tests/integration/conftest.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)