Skip to content

Commit

Permalink
tox: alternative way to test fastapi and fastapi slim
Browse files Browse the repository at this point in the history
  • Loading branch information
xrmx committed Aug 5, 2024
1 parent 4030ecd commit 413160f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
1 change: 0 additions & 1 deletion .github/workflows/instrumentations_1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
- "resource-detector-azure"
- "resource-detector-container"
- "util-http"
- "fastapislim"
- "processor-baggage"
os: [ubuntu-20.04]
exclude:
Expand Down
15 changes: 4 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,8 @@ envlist =
lint-instrumentation-falcon

; opentelemetry-instrumentation-fastapi
py3{8,9,10,11,12}-test-instrumentation-fastapi
py3{8,9,10,11,12}-test-instrumentation-fastapislim
pypy3-test-instrumentation-fastapi
pypy3-test-instrumentation-fastapislim
py3{8,9,10,11,12}-test-instrumentation-fastapi-{main,slim}
pypy3-test-instrumentation-fastapi-{main,slim)
lint-instrumentation-fastapi

; opentelemetry-instrumentation-flask
Expand Down Expand Up @@ -555,12 +553,8 @@ commands_pre =
fastapi: pip install opentelemetry-semantic-conventions@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions
fastapi: pip install opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk
fastapi: pip install opentelemetry-test-utils@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils
fastapi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt
fastapislim: pip install opentelemetry-api@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api
fastapislim: pip install opentelemetry-semantic-conventions@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions
fastapislim: pip install opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk
fastapislim: pip install opentelemetry-test-utils@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils
fastapislim: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements-slim.txt
fastapi-main: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt
fastapi-slim: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements-slim.txt

mysql: pip install opentelemetry-api@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api
mysql: pip install opentelemetry-semantic-conventions@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions
Expand Down Expand Up @@ -903,7 +897,6 @@ commands =
lint-instrumentation-fastapi: isort --diff --check-only --settings-path {toxinidir}/.isort.cfg {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi
lint-instrumentation-fastapi: flake8 --config {toxinidir}/.flake8 {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi
lint-instrumentation-fastapi: sh -c "cd instrumentation && pylint --rcfile ../.pylintrc opentelemetry-instrumentation-fastapi"
test-instrumentation-fastapislim: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi/tests {posargs}

test-instrumentation-flask: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-flask/tests {posargs}
lint-instrumentation-flask: black --diff --check --config {toxinidir}/pyproject.toml {toxinidir}/instrumentation/opentelemetry-instrumentation-flask
Expand Down

0 comments on commit 413160f

Please sign in to comment.