mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-27 04:03:09 +08:00

This commit ports the OpenTracing testbed[1] to check that the ot-shim is working as expected using different frameworks. Gevent doesn't support context vars yet[2], so those tests are not compatible with opentelemetry and were not ported. [1] https://github.com/opentracing/opentracing-python/tree/master/testbed [2] https://github.com/gevent/gevent/issues/1407 Co-authored-by: Mauricio Vásquez <mauricio@kinvolk.io> Co-authored-by: alrex <aboten@lightstep.com>
53 lines
1.3 KiB
Bash
Executable File
53 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
function cov {
|
|
if [ ${TOX_ENV_NAME:0:4} == "py34" ]
|
|
then
|
|
pytest \
|
|
--ignore-glob=*/setup.py \
|
|
--ignore-glob=ext/opentelemetry-ext-opentracing-shim/tests/testbed/* \
|
|
--cov ${1} \
|
|
--cov-append \
|
|
--cov-branch \
|
|
--cov-report='' \
|
|
${1}
|
|
else
|
|
pytest \
|
|
--ignore-glob=*/setup.py \
|
|
--cov ${1} \
|
|
--cov-append \
|
|
--cov-branch \
|
|
--cov-report='' \
|
|
${1}
|
|
fi
|
|
}
|
|
|
|
PYTHON_VERSION=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:3])))')
|
|
PYTHON_VERSION_INFO=(${PYTHON_VERSION//./ })
|
|
|
|
coverage erase
|
|
|
|
cov opentelemetry-api
|
|
cov opentelemetry-sdk
|
|
cov ext/opentelemetry-ext-datadog
|
|
cov ext/opentelemetry-ext-flask
|
|
cov ext/opentelemetry-ext-requests
|
|
cov ext/opentelemetry-ext-jaeger
|
|
cov ext/opentelemetry-ext-opentracing-shim
|
|
cov ext/opentelemetry-ext-wsgi
|
|
cov ext/opentelemetry-ext-zipkin
|
|
cov docs/examples/opentelemetry-example-app
|
|
|
|
# aiohttp is only supported on Python 3.5+.
|
|
if [ ${PYTHON_VERSION_INFO[1]} -gt 4 ]; then
|
|
cov ext/opentelemetry-ext-aiohttp-client
|
|
# ext-asgi is only supported on Python 3.5+.
|
|
if [ ${PYTHON_VERSION_INFO[1]} -gt 4 ]; then
|
|
cov ext/opentelemetry-ext-asgi
|
|
fi
|
|
|
|
coverage report --show-missing
|
|
coverage xml
|