Skip to content

Commit 544a9ff

Browse files
committed
feat(toxgen): Generate TESTPATHs for integrated test suites
1 parent 6325924 commit 544a9ff

File tree

5 files changed

+31
-68
lines changed

5 files changed

+31
-68
lines changed

scripts/populate_tox/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,5 +207,4 @@ picked (this doesn't count towards `num_versions`).
207207
"Defining constraints" section for the format.
208208
3. Add the integration to one of the groups in the `GROUPS` dictionary in
209209
`scripts/split_tox_gh_actions/split_tox_gh_actions.py`.
210-
4. Add the `TESTPATH` for the test suite in `tox.jinja`'s `setenv` section.
211-
5. Run `scripts/generate-test-files.sh` and commit the changes.
210+
4. Run `scripts/generate-test-files.sh` and commit the changes.

scripts/populate_tox/populate_tox.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,11 @@ def _render_dependencies(integration: str, releases: list[Version]) -> list[str]
513513
def write_tox_file(packages: dict) -> None:
514514
template = ENV.get_template("tox.jinja")
515515

516-
context = {"groups": {}}
516+
context = {
517+
"groups": {},
518+
"testpaths": [],
519+
}
520+
517521
for group, integrations in packages.items():
518522
context["groups"][group] = []
519523
for integration in integrations:
@@ -528,6 +532,14 @@ def write_tox_file(packages: dict) -> None:
528532
),
529533
}
530534
)
535+
context["testpaths"].append(
536+
(
537+
integration["name"],
538+
f"tests/integrations/{integration['integration_name']}",
539+
)
540+
)
541+
542+
context["testpaths"].sort()
531543

532544
rendered = template.render(context)
533545

@@ -759,6 +771,10 @@ def main(fail_on_changes: bool = False) -> None:
759771
"package": package,
760772
"extra": extra,
761773
"releases": test_releases,
774+
"integration_name": TEST_SUITE_CONFIG[integration].get(
775+
"integration_name"
776+
)
777+
or integration,
762778
}
763779
)
764780

scripts/populate_tox/releases.jsonl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
{"info": {"classifiers": ["Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7"], "name": "boto3", "requires_python": "", "version": "1.12.49", "yanked": false}}
4747
{"info": {"classifiers": ["Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9"], "name": "boto3", "requires_python": ">= 3.6", "version": "1.20.54", "yanked": false}}
4848
{"info": {"classifiers": ["Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9"], "name": "boto3", "requires_python": ">= 3.7", "version": "1.28.85", "yanked": false}}
49-
{"info": {"classifiers": ["Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", "Programming Language :: Python :: 3.9"], "name": "boto3", "requires_python": ">=3.9", "version": "1.40.37", "yanked": false}}
49+
{"info": {"classifiers": ["Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", "Programming Language :: Python :: 3.9"], "name": "boto3", "requires_python": ">=3.9", "version": "1.40.38", "yanked": false}}
5050
{"info": {"classifiers": ["Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries", "Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Internet :: WWW/HTTP :: WSGI", "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", "Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware", "Topic :: Internet :: WWW/HTTP :: WSGI :: Server", "Topic :: Software Development :: Libraries :: Application Frameworks"], "name": "bottle", "requires_python": "", "version": "0.12.25", "yanked": false}}
5151
{"info": {"classifiers": ["Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries", "Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Internet :: WWW/HTTP :: WSGI", "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", "Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware", "Topic :: Internet :: WWW/HTTP :: WSGI :: Server", "Topic :: Software Development :: Libraries :: Application Frameworks"], "name": "bottle", "requires_python": null, "version": "0.13.4", "yanked": false}}
5252
{"info": {"classifiers": ["Development Status :: 5 - Production/Stable", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Object Brokering", "Topic :: System :: Distributed Computing"], "name": "celery", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "version": "4.4.7", "yanked": false}}

scripts/populate_tox/tox.jinja

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -138,67 +138,18 @@ setenv =
138138
139139
common: TESTPATH=tests
140140
gevent: TESTPATH=tests
141-
aiohttp: TESTPATH=tests/integrations/aiohttp
142-
anthropic: TESTPATH=tests/integrations/anthropic
143-
ariadne: TESTPATH=tests/integrations/ariadne
144-
arq: TESTPATH=tests/integrations/arq
145141
asgi: TESTPATH=tests/integrations/asgi
146-
asyncpg: TESTPATH=tests/integrations/asyncpg
147142
aws_lambda: TESTPATH=tests/integrations/aws_lambda
148-
beam: TESTPATH=tests/integrations/beam
149-
boto3: TESTPATH=tests/integrations/boto3
150-
bottle: TESTPATH=tests/integrations/bottle
151-
celery: TESTPATH=tests/integrations/celery
152-
chalice: TESTPATH=tests/integrations/chalice
153-
clickhouse_driver: TESTPATH=tests/integrations/clickhouse_driver
154-
cohere: TESTPATH=tests/integrations/cohere
155143
cloud_resource_context: TESTPATH=tests/integrations/cloud_resource_context
156-
django: TESTPATH=tests/integrations/django
157-
dramatiq: TESTPATH=tests/integrations/dramatiq
158-
falcon: TESTPATH=tests/integrations/falcon
159-
fastapi: TESTPATH=tests/integrations/fastapi
160-
flask: TESTPATH=tests/integrations/flask
161144
gcp: TESTPATH=tests/integrations/gcp
162-
gql: TESTPATH=tests/integrations/gql
163-
graphene: TESTPATH=tests/integrations/graphene
164-
grpc: TESTPATH=tests/integrations/grpc
165-
httpx: TESTPATH=tests/integrations/httpx
166-
huey: TESTPATH=tests/integrations/huey
167-
huggingface_hub: TESTPATH=tests/integrations/huggingface_hub
168-
langchain-base: TESTPATH=tests/integrations/langchain
169-
langchain-notiktoken: TESTPATH=tests/integrations/langchain
170-
langgraph: TESTPATH=tests/integrations/langgraph
171-
launchdarkly: TESTPATH=tests/integrations/launchdarkly
172-
litestar: TESTPATH=tests/integrations/litestar
173-
loguru: TESTPATH=tests/integrations/loguru
174-
openai-base: TESTPATH=tests/integrations/openai
175-
openai-notiktoken: TESTPATH=tests/integrations/openai
176-
openai_agents: TESTPATH=tests/integrations/openai_agents
177-
openfeature: TESTPATH=tests/integrations/openfeature
178145
opentelemetry: TESTPATH=tests/integrations/opentelemetry
179146
potel: TESTPATH=tests/integrations/opentelemetry
180-
pure_eval: TESTPATH=tests/integrations/pure_eval
181-
pymongo: TESTPATH=tests/integrations/pymongo
182-
pyramid: TESTPATH=tests/integrations/pyramid
183-
quart: TESTPATH=tests/integrations/quart
184-
ray: TESTPATH=tests/integrations/ray
185-
redis: TESTPATH=tests/integrations/redis
186-
redis_py_cluster_legacy: TESTPATH=tests/integrations/redis_py_cluster_legacy
187-
requests: TESTPATH=tests/integrations/requests
188-
rq: TESTPATH=tests/integrations/rq
189-
sanic: TESTPATH=tests/integrations/sanic
190-
spark: TESTPATH=tests/integrations/spark
191-
sqlalchemy: TESTPATH=tests/integrations/sqlalchemy
192-
starlette: TESTPATH=tests/integrations/starlette
193-
starlite: TESTPATH=tests/integrations/starlite
194-
statsig: TESTPATH=tests/integrations/statsig
195-
strawberry: TESTPATH=tests/integrations/strawberry
196-
tornado: TESTPATH=tests/integrations/tornado
197-
trytond: TESTPATH=tests/integrations/trytond
198-
typer: TESTPATH=tests/integrations/typer
199-
unleash: TESTPATH=tests/integrations/unleash
200147
socket: TESTPATH=tests/integrations/socket
201148
149+
{% for integration, testpath in testpaths %}
150+
{{ integration }}: TESTPATH={{ testpath }}
151+
{% endfor %}
152+
202153
passenv =
203154
SENTRY_PYTHON_TEST_POSTGRES_HOST
204155
SENTRY_PYTHON_TEST_POSTGRES_USER

tox.ini

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ envlist =
9191
{py3.6,py3.7}-boto3-v1.12.49
9292
{py3.6,py3.9,py3.10}-boto3-v1.20.54
9393
{py3.7,py3.11,py3.12}-boto3-v1.28.85
94-
{py3.9,py3.12,py3.13}-boto3-v1.40.37
94+
{py3.9,py3.12,py3.13}-boto3-v1.40.38
9595

9696
{py3.6,py3.7,py3.8}-chalice-v1.16.0
9797
{py3.9,py3.12,py3.13}-chalice-v1.32.0
@@ -396,7 +396,7 @@ deps =
396396
boto3-v1.12.49: boto3==1.12.49
397397
boto3-v1.20.54: boto3==1.20.54
398398
boto3-v1.28.85: boto3==1.28.85
399-
boto3-v1.40.37: boto3==1.40.37
399+
boto3-v1.40.38: boto3==1.40.38
400400
{py3.7,py3.8}-boto3: urllib3<2.0.0
401401

402402
chalice-v1.16.0: chalice==1.16.0
@@ -715,27 +715,27 @@ setenv =
715715

716716
common: TESTPATH=tests
717717
gevent: TESTPATH=tests
718+
socket: TESTPATH=tests/integrations/socket
719+
asgi: TESTPATH=tests/integrations/asgi
720+
gcp: TESTPATH=tests/integrations/gcp
721+
718722
aiohttp: TESTPATH=tests/integrations/aiohttp
719723
anthropic: TESTPATH=tests/integrations/anthropic
720724
ariadne: TESTPATH=tests/integrations/ariadne
721725
arq: TESTPATH=tests/integrations/arq
722-
asgi: TESTPATH=tests/integrations/asgi
723726
asyncpg: TESTPATH=tests/integrations/asyncpg
724-
aws_lambda: TESTPATH=tests/integrations/aws_lambda
725727
beam: TESTPATH=tests/integrations/beam
726728
boto3: TESTPATH=tests/integrations/boto3
727729
bottle: TESTPATH=tests/integrations/bottle
728730
celery: TESTPATH=tests/integrations/celery
729731
chalice: TESTPATH=tests/integrations/chalice
730732
clickhouse_driver: TESTPATH=tests/integrations/clickhouse_driver
731733
cohere: TESTPATH=tests/integrations/cohere
732-
cloud_resource_context: TESTPATH=tests/integrations/cloud_resource_context
733734
django: TESTPATH=tests/integrations/django
734735
dramatiq: TESTPATH=tests/integrations/dramatiq
735736
falcon: TESTPATH=tests/integrations/falcon
736-
fastapi: TESTPATH=tests/integrations/fastapi
737+
fastapi: TESTPATH=tests/integrations/fastapi
737738
flask: TESTPATH=tests/integrations/flask
738-
gcp: TESTPATH=tests/integrations/gcp
739739
gql: TESTPATH=tests/integrations/gql
740740
graphene: TESTPATH=tests/integrations/graphene
741741
grpc: TESTPATH=tests/integrations/grpc
@@ -744,16 +744,14 @@ setenv =
744744
huggingface_hub: TESTPATH=tests/integrations/huggingface_hub
745745
langchain-base: TESTPATH=tests/integrations/langchain
746746
langchain-notiktoken: TESTPATH=tests/integrations/langchain
747-
langgraph: TESTPATH=tests/integrations/langgraph
747+
langgraph: TESTPATH=tests/integrations/langgraph
748748
launchdarkly: TESTPATH=tests/integrations/launchdarkly
749749
litestar: TESTPATH=tests/integrations/litestar
750750
loguru: TESTPATH=tests/integrations/loguru
751751
openai-base: TESTPATH=tests/integrations/openai
752752
openai-notiktoken: TESTPATH=tests/integrations/openai
753753
openai_agents: TESTPATH=tests/integrations/openai_agents
754754
openfeature: TESTPATH=tests/integrations/openfeature
755-
opentelemetry: TESTPATH=tests/integrations/opentelemetry
756-
potel: TESTPATH=tests/integrations/opentelemetry
757755
pure_eval: TESTPATH=tests/integrations/pure_eval
758756
pymongo: TESTPATH=tests/integrations/pymongo
759757
pyramid: TESTPATH=tests/integrations/pyramid
@@ -774,7 +772,6 @@ setenv =
774772
trytond: TESTPATH=tests/integrations/trytond
775773
typer: TESTPATH=tests/integrations/typer
776774
unleash: TESTPATH=tests/integrations/unleash
777-
socket: TESTPATH=tests/integrations/socket
778775

779776
passenv =
780777
SENTRY_PYTHON_TEST_POSTGRES_HOST

0 commit comments

Comments
 (0)