Skip to content

Commit

Permalink
Refactor use of changedir in tox.ini (open-telemetry#2332)
Browse files Browse the repository at this point in the history
Fixes #3745
  • Loading branch information
ocelotl committed Mar 6, 2024
1 parent 8daa8ad commit 24e1eab
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ dependencies = [
instruments = [
"elasticsearch >= 2.0",
]
test = [
"opentelemetry-instrumentation-elasticsearch[instruments]",
"elasticsearch-dsl >= 2.0",
"opentelemetry-test-utils == 0.45b0.dev",
]

[project.entry-points.opentelemetry_instrumentor]
elasticsearch = "opentelemetry.instrumentation.elasticsearch:ElasticsearchInstrumentor"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
asgiref==3.7.2
attrs==23.2.0
Deprecated==1.2.14
elasticsearch==2.4.1
elasticsearch-dsl==2.2.0
importlib-metadata==6.11.0
iniconfig==2.0.0
packaging==23.2
pluggy==1.4.0
py==1.11.0
py-cpuinfo==9.0.0
pytest==7.1.3
pytest-benchmark==4.0.0
python-dateutil==2.8.2
six==1.16.0
tomli==2.0.1
typing_extensions==4.10.0
urllib3==1.26.18
wrapt==1.16.0
zipp==3.17.0
-e ../../../opentelemetry-instrumentation
-e ../../../instrumentation/opentelemetry-instrumentation-elasticsearch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
asgiref==3.7.2
attrs==23.2.0
Deprecated==1.2.14
elasticsearch==5.5.3
elasticsearch-dsl==5.4.0
importlib-metadata==6.11.0
iniconfig==2.0.0
packaging==23.2
pluggy==1.4.0
py==1.11.0
py-cpuinfo==9.0.0
pytest==7.1.3
pytest-benchmark==4.0.0
python-dateutil==2.8.2
six==1.16.0
tomli==2.0.1
typing_extensions==4.10.0
urllib3==2.2.1
wrapt==1.16.0
zipp==3.17.0
-e ../../../opentelemetry-instrumentation
-e ../../../instrumentation/opentelemetry-instrumentation-elasticsearch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
asgiref==3.7.2
attrs==23.2.0
Deprecated==1.2.14
elasticsearch==6.8.2
elasticsearch-dsl==6.4.0
importlib-metadata==6.11.0
iniconfig==2.0.0
packaging==23.2
pluggy==1.4.0
py==1.11.0
py-cpuinfo==9.0.0
pytest==7.1.3
pytest-benchmark==4.0.0
python-dateutil==2.8.2
six==1.16.0
tomli==2.0.1
typing_extensions==4.10.0
urllib3==2.2.1
wrapt==1.16.0
zipp==3.17.0
-e ../../../opentelemetry-instrumentation
-e ../../../instrumentation/opentelemetry-instrumentation-elasticsearch
146 changes: 70 additions & 76 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,16 @@ envlist =
; pypy3-test-instrumentation-boto

; opentelemetry-instrumentation-elasticsearch
py3{8,9,10,11}-test-instrumentation-elasticsearch-{2,6}
pypy3-test-instrumentation-elasticsearch-{2,6}
py3{8,9}-test-instrumentation-elasticsearch-5
pypy3-test-instrumentation-elasticsearch-5
; FIXME: Elasticsearch >=7 causes CI workflow tests to hang, see open-telemetry/opentelemetry-python-contrib#620
; The numbers at the end of the environment names
; below mean these dependencies are being used:
; 0: elasticsearch-dsl>=2.0,<3.0 elasticsearch>=2.0,<3.0
; 1: elasticsearch-dsl>=5.0,<6.0 elasticsearch>=5.0,<6.0
; 2: elasticsearch-dsl>=6.0,<7.0 elasticsearch>=6.0,<7.0
py3{8,9,10,11}-test-instrumentation-elasticsearch-{0,2}
pypy3-test-instrumentation-elasticsearch-{0,2}
py3{8,9}-test-instrumentation-elasticsearch-1
pypy3-test-instrumentation-elasticsearch-1

; opentelemetry-instrumentation-falcon
; py310 does not work with falcon 1
Expand Down Expand Up @@ -258,17 +264,6 @@ deps =
django-2: django~=2.0
django-3: django~=3.0
django-4: django>=4.0b1,<5.0
elasticsearch-2: elasticsearch-dsl>=2.0,<3.0
elasticsearch-2: elasticsearch>=2.0,<3.0
elasticsearch-5: elasticsearch-dsl>=5.0,<6.0
elasticsearch-5: elasticsearch>=5.0,<6.0
elasticsearch-6: elasticsearch-dsl>=6.0,<7.0
elasticsearch-6: elasticsearch>=6.0,<7.0
; FIXME: Elasticsearch >=7 causes CI workflow tests to hang, see open-telemetry/opentelemetry-python-contrib#620
; elasticsearch-7: elasticsearch-dsl>=7.0,<8.0
; elasticsearch-7: elasticsearch>=7.0,<8.0
; elasticsearch-8: elasticsearch-dsl>=8.0,<9.0
; elasticsearch-8: elasticsearch>=8.0,<9.0
falcon-1: falcon ==1.4.1
falcon-2: falcon >=2.0.0,<3.0.0
falcon-3: falcon >=3.0.0,<4.0.0
Expand Down Expand Up @@ -308,64 +303,6 @@ setenv =
CORE_REPO_SHA={env:CORE_REPO_SHA:main}
CORE_REPO=git+https://github.com/open-telemetry/opentelemetry-python.git@{env:CORE_REPO_SHA}

changedir =
test-distro: opentelemetry-distro/tests
test-opentelemetry-instrumentation: opentelemetry-instrumentation/tests
test-instrumentation-aiohttp-client: instrumentation/opentelemetry-instrumentation-aiohttp-client/tests
test-instrumentation-aiohttp-server: instrumentation/opentelemetry-instrumentation-aiohttp-server/tests
test-instrumentation-aiopg: instrumentation/opentelemetry-instrumentation-aiopg/tests
test-instrumentation-asgi: instrumentation/opentelemetry-instrumentation-asgi/tests
test-instrumentation-asyncpg: instrumentation/opentelemetry-instrumentation-asyncpg/tests
test-instrumentation-aws-lambda: instrumentation/opentelemetry-instrumentation-aws-lambda/tests
test-instrumentation-boto: instrumentation/opentelemetry-instrumentation-boto/tests
test-instrumentation-botocore: instrumentation/opentelemetry-instrumentation-botocore/tests
test-instrumentation-boto3sqs: instrumentation/opentelemetry-instrumentation-boto3sqs/tests
test-instrumentation-cassandra: instrumentation/opentelemetry-instrumentation-cassandra/tests
test-instrumentation-celery: instrumentation/opentelemetry-instrumentation-celery/tests
test-instrumentation-dbapi: instrumentation/opentelemetry-instrumentation-dbapi/tests
test-instrumentation-django-{1,2,3,4}: instrumentation/opentelemetry-instrumentation-django/tests
test-instrumentation-elasticsearch-{2,5,6}: instrumentation/opentelemetry-instrumentation-elasticsearch/tests
test-instrumentation-falcon-{1,2,3}: instrumentation/opentelemetry-instrumentation-falcon/tests
test-instrumentation-fastapi: instrumentation/opentelemetry-instrumentation-fastapi/tests
test-instrumentation-flask-{213,220,300}: instrumentation/opentelemetry-instrumentation-flask/tests
test-instrumentation-urllib: instrumentation/opentelemetry-instrumentation-urllib/tests
test-instrumentation-urllib3v-{1,2}: instrumentation/opentelemetry-instrumentation-urllib3/tests
test-instrumentation-grpc: instrumentation/opentelemetry-instrumentation-grpc/tests
test-instrumentation-jinja2: instrumentation/opentelemetry-instrumentation-jinja2/tests
test-instrumentation-kafka-python: instrumentation/opentelemetry-instrumentation-kafka-python/tests
test-instrumentation-confluent-kafka: instrumentation/opentelemetry-instrumentation-confluent-kafka/tests
test-instrumentation-logging: instrumentation/opentelemetry-instrumentation-logging/tests
test-instrumentation-mysql: instrumentation/opentelemetry-instrumentation-mysql/tests
test-instrumentation-mysqlclient: instrumentation/opentelemetry-instrumentation-mysqlclient/tests
test-instrumentation-sio-pika-{0,1}: instrumentation/opentelemetry-instrumentation-pika/tests
test-instrumentation-aio-pika-{8,9}: instrumentation/opentelemetry-instrumentation-aio-pika/tests
test-instrumentation-psycopg: instrumentation/opentelemetry-instrumentation-psycopg/tests
test-instrumentation-psycopg2: instrumentation/opentelemetry-instrumentation-psycopg2/tests
test-instrumentation-pymemcache-{135,200,300,342,400}: instrumentation/opentelemetry-instrumentation-pymemcache/tests
test-instrumentation-pymongo: instrumentation/opentelemetry-instrumentation-pymongo/tests
test-instrumentation-pymysql: instrumentation/opentelemetry-instrumentation-pymysql/tests
test-instrumentation-pyramid: instrumentation/opentelemetry-instrumentation-pyramid/tests
test-instrumentation-redis: instrumentation/opentelemetry-instrumentation-redis/tests
test-instrumentation-remoulade: instrumentation/opentelemetry-instrumentation-remoulade/tests
test-instrumentation-requests: instrumentation/opentelemetry-instrumentation-requests/tests
test-instrumentation-sklearn: instrumentation/opentelemetry-instrumentation-sklearn/tests
test-instrumentation-sqlalchemy-{11,14}: instrumentation/opentelemetry-instrumentation-sqlalchemy/tests
test-instrumentation-sqlite3: instrumentation/opentelemetry-instrumentation-sqlite3/tests
test-instrumentation-starlette: instrumentation/opentelemetry-instrumentation-starlette/tests
test-instrumentation-system-metrics: instrumentation/opentelemetry-instrumentation-system-metrics/tests
test-instrumentation-tornado: instrumentation/opentelemetry-instrumentation-tornado/tests
test-instrumentation-tortoiseorm: instrumentation/opentelemetry-instrumentation-tortoiseorm/tests
test-instrumentation-wsgi: instrumentation/opentelemetry-instrumentation-wsgi/tests
test-instrumentation-httpx-{18,21}: instrumentation/opentelemetry-instrumentation-httpx/tests
test-instrumentation-asyncio: instrumentation/opentelemetry-instrumentation-asyncio/tests
test-util-http: util/opentelemetry-util-http/tests
test-sdkextension-aws: sdk-extension/opentelemetry-sdk-extension-aws/tests
test-resource-detector-container: resource/opentelemetry-resource-detector-container/tests
test-propagator-aws: propagator/opentelemetry-propagator-aws-xray/tests
test-propagator-ot-trace: propagator/opentelemetry-propagator-ot-trace/tests
test-exporter-richconsole: exporter/opentelemetry-exporter-richconsole/tests
test-exporter-prometheus-remote-write: exporter/opentelemetry-exporter-prometheus-remote-write/tests

commands_pre =
; Install without -e to test the actual installation
py3{8,9,10,11}: python -m pip install -U pip setuptools wheel
Expand Down Expand Up @@ -474,7 +411,9 @@ commands_pre =

sqlalchemy-{11,14}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy[test]

elasticsearch-{2,5,6}: pip install {toxinidir}/opentelemetry-instrumentation[test] {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch[test]
elasticsearch-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt
elasticsearch-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt
elasticsearch-2: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt

asyncio: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio[test]

Expand All @@ -494,7 +433,62 @@ commands_pre =
coverage: python {toxinidir}/scripts/eachdist.py install --editable

commands =
test: pytest {posargs}
test-distro: pytest {toxinidir}/opentelemetry-distro/tests {posargs}
test-opentelemetry-instrumentation: pytest {toxinidir}/opentelemetry-instrumentation/tests {posargs}
test-instrumentation-aiohttp-client: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests {posargs}
test-instrumentation-aiohttp-server: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests {posargs}
test-instrumentation-aiopg: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg/tests {posargs}
test-instrumentation-asgi: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi/tests {posargs}
test-instrumentation-asyncpg: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg/tests {posargs}
test-instrumentation-aws-lambda: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-aws-lambda/tests {posargs}
test-instrumentation-boto: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-boto/tests {posargs}
test-instrumentation-botocore: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore/tests {posargs}
test-instrumentation-boto3sqs: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-boto3sqs/tests {posargs}
test-instrumentation-cassandra: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-cassandra/tests {posargs}
test-instrumentation-celery: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-celery/tests {posargs}
test-instrumentation-dbapi: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi/tests {posargs}
test-instrumentation-django-{1,2,3,4}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-django/tests {posargs}
test-instrumentation-elasticsearch-{2,5,6}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/tests {posargs}
test-instrumentation-falcon-{1,2,3}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon/tests {posargs}
test-instrumentation-fastapi: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi/tests {posargs}
test-instrumentation-flask-{213,220,300}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-flask/tests {posargs}
test-instrumentation-urllib: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib/tests {posargs}
test-instrumentation-urllib3v-{1,2}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3/tests {posargs}
test-instrumentation-grpc: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc/tests {posargs}
test-instrumentation-jinja2: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2/tests {posargs}
test-instrumentation-kafka-python: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python/tests {posargs}
test-instrumentation-confluent-kafka: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests {posargs}
test-instrumentation-logging: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-logging/tests {posargs}
test-instrumentation-mysql: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql/tests {posargs}
test-instrumentation-mysqlclient: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient/tests {posargs}
test-instrumentation-sio-pika-{0,1}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-pika/tests {posargs}
test-instrumentation-aio-pika-{8,9}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/tests {posargs}
test-instrumentation-psycopg: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg/tests {posargs}
test-instrumentation-psycopg2: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2/tests {posargs}
test-instrumentation-pymemcache-{135,200,300,342,400}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/tests {posargs}
test-instrumentation-pymongo: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo/tests {posargs}
test-instrumentation-pymysql: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql/tests {posargs}
test-instrumentation-pyramid: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-pyramid/tests {posargs}
test-instrumentation-redis: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-redis/tests {posargs}
test-instrumentation-remoulade: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade/tests {posargs}
test-instrumentation-requests: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-requests/tests {posargs}
test-instrumentation-sklearn: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-sklearn/tests {posargs}
test-instrumentation-sqlalchemy-{11,14}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests {posargs}
test-instrumentation-sqlite3: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3/tests {posargs}
test-instrumentation-starlette: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-starlette/tests {posargs}
test-instrumentation-system-metrics: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics/tests {posargs}
test-instrumentation-tornado: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado/tests {posargs}
test-instrumentation-tortoiseorm: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm/tests {posargs}
test-instrumentation-wsgi: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/tests {posargs}
test-instrumentation-httpx-{18,21}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx/tests {posargs}
test-instrumentation-asyncio: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio/tests {posargs}
test-util-http: pytest {toxinidir}/util/opentelemetry-util-http/tests {posargs}
test-sdkextension-aws: pytest {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws/tests {posargs}
test-resource-detector-container: pytest {toxinidir}/resource/opentelemetry-resource-detector-container/tests {posargs}
test-propagator-aws: pytest {toxinidir}/propagator/opentelemetry-propagator-aws-xray/tests {posargs}
test-propagator-ot-trace: pytest {toxinidir}/propagator/opentelemetry-propagator-ot-trace/tests {posargs}
test-exporter-richconsole: pytest {toxinidir}/exporter/opentelemetry-exporter-richconsole/tests {posargs}
test-exporter-prometheus-remote-write: pytest {toxinidir}/exporter/opentelemetry-exporter-prometheus-remote-write/tests {posargs}
coverage: {toxinidir}/scripts/coverage.sh

[testenv:docs]
Expand Down Expand Up @@ -577,7 +571,7 @@ commands_pre =
# for your OS to install the required dependencies
python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient[test]
python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo[test]
python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch[test]
pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt
python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg[test]
python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado[test]
python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm[test]
Expand Down

0 comments on commit 24e1eab

Please sign in to comment.