Modify existing workflow for CI tests

This commit is contained in:
Nathaniel Ruiz Nowell
2020-11-03 10:33:19 -08:00
parent 48217da7cf
commit 82e44f165e
9 changed files with 49 additions and 165 deletions

View File

@ -4,3 +4,4 @@ omit =
*/setup.py
*/gen/*
reference/*
opentelemetry-python-core/*

View File

@ -21,5 +21,6 @@ exclude =
exporter/opentelemetry-exporter-jaeger/build/*
docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/grpc/gen/
docs/examples/opentelemetry-example-app/build/*
opentelemetry-python-core/
opentelemetry-proto/build/*
opentelemetry-proto/src/opentelemetry/proto/

View File

@ -1,4 +1,4 @@
name: Test
name: Contrib Repo Tests
on:
push:
@ -20,18 +20,9 @@ jobs:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
python-version: [ py35, py36, py37, py38, pypy3 ]
package: ["instrumentation", "core", "exporter"]
package: ["instrumentation", "exporter"]
os: [ ubuntu-latest ]
include:
- python-version: py38
package: "tracecontext"
os: ubuntu-latest
- python-version: py38
package: "mypy"
os: ubuntu-latest
- python-version: py38
package: "mypyinstalled"
os: ubuntu-latest
# py35-instrumentation segfaults on 18.04 so we instead run on 20.04
- python-version: py35
package: instrumentation
@ -41,7 +32,14 @@ jobs:
python-version: py35
package: instrumentation
steps:
- uses: actions/checkout@v2
- name: Checkout Contrib Repo at SHA - ${{ github.sha }}
uses: actions/checkout@v2
- name: Checkout Core Repo @ tag v0.15b0
uses: actions/checkout@v2
with:
repository: open-telemetry/opentelemetry-python
ref: v0.15b0
path: opentelemetry-python-core
- name: Set up Python ${{ env[matrix.python-version] }}
uses: actions/setup-python@v2
with:
@ -60,11 +58,18 @@ jobs:
strategy:
fail-fast: false
matrix:
tox-environment: [ "docker-tests", "lint", "docs" ]
tox-environment: [ "docker-tests", "lint" ]
name: ${{ matrix.tox-environment }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout Contrib Repo at SHA - ${{ github.sha }}
uses: actions/checkout@v2
- name: Checkout Core Repo @ tag v0.15b0
uses: actions/checkout@v2
with:
repository: open-telemetry/opentelemetry-python
ref: v0.15b0
path: opentelemetry-python-core
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
@ -78,4 +83,4 @@ jobs:
path: .tox
key: tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}
- name: run tox
run: tox -e ${{ matrix.tox-environment }}
run: tox -e ${{ matrix.tox-environment }}

1
.gitignore vendored
View File

@ -21,6 +21,7 @@ lib64
__pycache__
venv*/
.venv*/
opentelemetry-python-core*/
# Installer logs
pip-log.txt

View File

@ -13,6 +13,6 @@ line_length=79
; docs: https://github.com/timothycrosley/isort#multi-line-output-modes
multi_line_output=3
skip=target
skip_glob=**/gen/*,.venv*/*,venv*/*,reference*/*
skip_glob=**/gen/*,.venv*/*,venv*/*,reference*/*,opentelemetry-python-core*/*
known_first_party=opentelemetry
known_third_party=psutil,pytest,redis,redis_opentracing

View File

@ -7,7 +7,7 @@ extension-pkg-whitelist=
# Add list of files or directories to be excluded. They should be base names, not
# paths.
ignore=CVS,gen
ignore=CVS,gen,opentelemetry-python-core
# Add files or directories matching the regex patterns to be excluded. The
# regex matches against base names, not paths.

View File

@ -4,13 +4,9 @@
ignore=
_template
reference
opentelemetry-python-core
sortfirst=
opentelemetry-api
opentelemetry-sdk
opentelemetry-instrumentation
opentelemetry-proto
tests/util
instrumentation/opentelemetry-instrumentation-wsgi
instrumentation/opentelemetry-instrumentation-dbapi
instrumentation/opentelemetry-instrumentation-asgi

View File

@ -3,7 +3,8 @@ line-length = 79
exclude = '''
(
/(
reference # original files from DataDog
reference|
opentelemetry-python-core
)/
)
'''

163
tox.ini
View File

@ -4,29 +4,6 @@ skip_missing_interpreters = True
envlist =
; Environments are organized by individual package, allowing
; for specifying supported Python versions per package.
; opentelemetry-api
py3{5,6,7,8}-test-core-api
pypy3-test-core-api
; opentelemetry-proto
py3{5,6,7,8}-test-core-proto
pypy3-test-core-proto
; opentelemetry-sdk
py3{5,6,7,8}-test-core-sdk
pypy3-test-core-sdk
; opentelemetry-instrumentation
py3{5,6,7,8}-test-core-instrumentation
pypy3-test-core-instrumentation
; docs/getting-started
py3{5,6,7,8}-test-core-getting-started
pypy3-test-core-getting-started
; opentelemetry-example-app
py3{5,6,7,8}-test-instrumentation-example-app
pypy3-test-instrumentation-example-app
; opentelemetry-instrumentation-aiohttp-client
py3{5,6,7,8}-test-instrumentation-aiohttp-client
@ -82,10 +59,6 @@ envlist =
py3{5,6,7,8}-test-instrumentation-jinja2
pypy3-test-instrumentation-jinja2
; opentelemetry-exporter-jaeger
py3{5,6,7,8}-test-exporter-jaeger
pypy3-test-exporter-jaeger
; opentelemetry-exporter-datadog
py3{5,6,7,8}-test-exporter-datadog
@ -93,18 +66,6 @@ envlist =
py3{5,6,7,8}-test-instrumentation-mysql
pypy3-test-instrumentation-mysql
; opentelemetry-exporter-opencensus
py3{5,6,7,8}-test-exporter-opencensus
; exporter-opencensus intentionally excluded from pypy3
; opentelemetry-exporter-otlp
py3{5,6,7,8}-test-exporter-otlp
; exporter-otlp intentionally excluded from pypy3
; opentelemetry-exporter-prometheus
py3{5,6,7,8}-test-exporter-prometheus
pypy3-test-exporter-prometheus
; opentelemetry-instrumentation-psycopg2
py3{5,6,7,8}-test-instrumentation-psycopg2
; ext-psycopg2 intentionally excluded from pypy3
@ -141,14 +102,6 @@ envlist =
py3{5,6,7,8}-test-instrumentation-wsgi
pypy3-test-instrumentation-wsgi
; opentelemetry-exporter-zipkin
py3{5,6,7,8}-test-exporter-zipkin
pypy3-test-exporter-zipkin
; opentelemetry-opentracing-shim
py3{5,6,7,8}-test-core-opentracing-shim
pypy3-test-core-opentracing-shim
; opentelemetry-instrumentation-grpc
py3{5,6,7,8}-test-instrumentation-grpc
@ -175,9 +128,6 @@ envlist =
pypy3-test-instrumentation-tornado
lint
py38-tracecontext
py38-{mypy,mypyinstalled}
docs
docker-tests
[testenv]
@ -186,7 +136,6 @@ deps =
test: pytest
coverage: pytest
coverage: pytest-cov
mypy,mypyinstalled: mypy
elasticsearch2: elasticsearch-dsl>=2.0,<3.0
elasticsearch2: elasticsearch>=2.0,<3.0
elasticsearch5: elasticsearch-dsl>=5.0,<6.0
@ -199,16 +148,7 @@ deps =
; FIXME: add coverage testing
; FIXME: add mypy testing
setenv = mypy: MYPYPATH={toxinidir}/opentelemetry-api/src/
changedir =
test-core-api: opentelemetry-api/tests
test-core-sdk: opentelemetry-sdk/tests
test-core-proto: opentelemetry-proto/tests
test-core-instrumentation: opentelemetry-instrumentation/tests
test-core-getting-started: docs/getting_started/tests
test-core-opentracing-shim: instrumentation/opentelemetry-instrumentation-opentracing-shim/tests
test-instrumentation-aiohttp-client: instrumentation/opentelemetry-instrumentation-aiohttp-client/tests
test-instrumentation-aiopg: instrumentation/opentelemetry-instrumentation-aiopg/tests
test-instrumentation-asgi: instrumentation/opentelemetry-instrumentation-asgi/tests
@ -218,7 +158,6 @@ changedir =
test-instrumentation-celery: instrumentation/opentelemetry-instrumentation-celery/tests
test-instrumentation-dbapi: instrumentation/opentelemetry-instrumentation-dbapi/tests
test-instrumentation-django: instrumentation/opentelemetry-instrumentation-django/tests
test-instrumentation-example-app: docs/examples/opentelemetry-example-app/tests
test-instrumentation-elasticsearch{2,5,6,7}: instrumentation/opentelemetry-instrumentation-elasticsearch/tests
test-instrumentation-falcon: instrumentation/opentelemetry-instrumentation-falcon/tests
test-instrumentation-fastapi: instrumentation/opentelemetry-instrumentation-fastapi/tests
@ -240,27 +179,17 @@ changedir =
test-instrumentation-tornado: instrumentation/opentelemetry-instrumentation-tornado/tests
test-instrumentation-wsgi: instrumentation/opentelemetry-instrumentation-wsgi/tests
test-exporter-jaeger: exporter/opentelemetry-exporter-jaeger/tests
test-exporter-datadog: exporter/opentelemetry-exporter-datadog/tests
test-exporter-opencensus: exporter/opentelemetry-exporter-opencensus/tests
test-exporter-otlp: exporter/opentelemetry-exporter-otlp/tests
test-exporter-prometheus: exporter/opentelemetry-exporter-prometheus/tests
test-exporter-zipkin: exporter/opentelemetry-exporter-zipkin/tests
commands_pre =
; Install without -e to test the actual installation
py3{5,6,7,8}: python -m pip install -U pip setuptools wheel
; Install common packages for all the tests. These are not needed in all the
; cases but it saves a lot of boilerplate in this file.
test: pip install {toxinidir}/opentelemetry-api {toxinidir}/opentelemetry-sdk {toxinidir}/tests/util
test-core-proto: pip install {toxinidir}/opentelemetry-proto
instrumentation: pip install {toxinidir}/opentelemetry-instrumentation
example-app: pip install {toxinidir}/opentelemetry-instrumentation {toxinidir}/instrumentation/opentelemetry-instrumentation-requests {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi {toxinidir}/instrumentation/opentelemetry-instrumentation-flask {toxinidir}/docs/examples/opentelemetry-example-app
getting-started: pip install -e {toxinidir}/opentelemetry-instrumentation -e {toxinidir}/instrumentation/opentelemetry-instrumentation-requests -e {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi -e {toxinidir}/instrumentation/opentelemetry-instrumentation-flask
test: pip install {toxinidir}/opentelemetry-python-core/opentelemetry-api {toxinidir}/opentelemetry-python-core/opentelemetry-sdk {toxinidir}/opentelemetry-python-core/tests/util
test: pip install {toxinidir}/opentelemetry-python-core/opentelemetry-instrumentation
celery: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-celery[test]
grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test]
@ -287,13 +216,6 @@ commands_pre =
mysql: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql[test]
opencensus: pip install {toxinidir}/exporter/opentelemetry-exporter-opencensus
otlp: pip install {toxinidir}/opentelemetry-proto
otlp: pip install {toxinidir}/exporter/opentelemetry-exporter-otlp
prometheus: pip install {toxinidir}/exporter/opentelemetry-exporter-prometheus
pymemcache: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache[test]
pymongo: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo[test]
@ -316,49 +238,40 @@ commands_pre =
jinja2: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2[test]
aiohttp-client: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client
aiohttp-client: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client
aiopg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg[test]
jaeger: pip install {toxinidir}/exporter/opentelemetry-exporter-jaeger
opentracing-shim: pip install {toxinidir}/opentelemetry-sdk
opentracing-shim: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-opentracing-shim
datadog: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/exporter/opentelemetry-exporter-datadog
zipkin: pip install {toxinidir}/exporter/opentelemetry-exporter-zipkin
datadog: pip install {toxinidir}/exporter/opentelemetry-exporter-datadog
sqlalchemy: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy
system-metrics: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics[test]
elasticsearch{2,5,6,7}: pip install {toxinidir}/opentelemetry-instrumentation {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch[test]
elasticsearch{2,5,6,7}: pip install {toxinidir}/opentelemetry-python-core/opentelemetry-instrumentation {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch[test]
; In order to get a healthy coverage report,
; we have to install packages in editable mode.
coverage: python {toxinidir}/scripts/eachdist.py install --editable
; Using file:// here because otherwise tox invokes just "pip install
; opentelemetry-api", leading to an error
mypyinstalled: pip install file://{toxinidir}/opentelemetry-api/
commands =
test: pytest {posargs}
coverage: {toxinidir}/scripts/coverage.sh
mypy: mypy --namespace-packages opentelemetry-api/src/opentelemetry/
; For test code, we don't want to enforce the full mypy strictness
mypy: mypy --namespace-packages --config-file=mypy-relaxed.ini opentelemetry-api/tests/
; Test that mypy can pick up typeinfo from an installed package (otherwise,
; implicit Any due to unfollowed import would result).
mypyinstalled: mypy --namespace-packages opentelemetry-api/tests/mypysmoke.py --strict
[testenv:lint]
basepython: python3.8
recreate = True
deps =
-e {toxinidir}/opentelemetry-python-core/opentelemetry-proto
-e {toxinidir}/opentelemetry-python-core/opentelemetry-api
-e {toxinidir}/opentelemetry-python-core/opentelemetry-sdk
-e {toxinidir}/opentelemetry-python-core/opentelemetry-instrumentation
-e {toxinidir}/opentelemetry-python-core/opentelemetry-proto
-e {toxinidir}/opentelemetry-python-core/tests/util
-e {toxinidir}/opentelemetry-python-core/exporter/opentelemetry-exporter-jaeger
-e {toxinidir}/opentelemetry-python-core/exporter/opentelemetry-exporter-zipkin
-e {toxinidir}/opentelemetry-python-core/exporter/opentelemetry-exporter-prometheus
-e {toxinidir}/opentelemetry-python-core/exporter/opentelemetry-exporter-otlp
-c dev-requirements.txt
pylint
flake8
@ -374,40 +287,6 @@ commands_pre =
commands =
python scripts/eachdist.py lint --check-only
[testenv:docs]
deps =
-c {toxinidir}/dev-requirements.txt
-r {toxinidir}/docs-requirements.txt
commands_pre =
pip install -e {toxinidir}/opentelemetry-api \
-e {toxinidir}/opentelemetry-sdk
changedir = docs
commands =
sphinx-build -E -a -W -b html -T . _build/html
[testenv:py38-tracecontext]
basepython: python3.8
deps =
# needed for tracecontext
aiohttp~=3.6
# needed for example trace integration
flask~=1.1
requests~=2.7
commands_pre =
pip install -e {toxinidir}/opentelemetry-api \
-e {toxinidir}/opentelemetry-sdk \
-e {toxinidir}/opentelemetry-instrumentation \
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-requests \
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi \
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-flask
commands =
{toxinidir}/scripts/tracecontext-integration-test.sh
[testenv:docker-tests]
deps =
pytest
@ -426,10 +305,10 @@ changedir =
tests/opentelemetry-docker-tests/tests
commands_pre =
pip install -e {toxinidir}/opentelemetry-api \
-e {toxinidir}/opentelemetry-sdk \
-e {toxinidir}/opentelemetry-instrumentation \
-e {toxinidir}/tests/util \
pip install -e {toxinidir}/opentelemetry-python-core/opentelemetry-api \
-e {toxinidir}/opentelemetry-python-core/opentelemetry-sdk \
-e {toxinidir}/opentelemetry-python-core/opentelemetry-instrumentation \
-e {toxinidir}/opentelemetry-python-core/tests/util \
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg \
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-celery \
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi \
@ -441,7 +320,7 @@ commands_pre =
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg \
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-redis \
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics \
-e {toxinidir}/exporter/opentelemetry-exporter-opencensus
-e {toxinidir}/opentelemetry-python-core/exporter/opentelemetry-exporter-opencensus
docker-compose up -d
python check_availability.py
commands =