diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml new file mode 100644 index 00000000000..2d7a6efd733 --- /dev/null +++ b/.github/workflows/benchmarks.yml @@ -0,0 +1,54 @@ +name: SDK Benchmark Tests + +on: + push: + branches: [ main ] + +jobs: + sdk-benchmarks: + env: + py311: "3.11" + RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-sdk-${{ matrix.os }} + runs-on: self-hosted + strategy: + # Ensures the entire test matrix is run, even if one permutation fails + fail-fast: false + matrix: + python-version: [py311] + os: [ubuntu-20.04, windows-2019] + steps: + - name: Checkout Core Repo @ SHA - ${{ github.sha }} + uses: actions/checkout@v2 + - name: Set up Python ${{ env[matrix.python-version] }} + uses: actions/setup-python@v2 + with: + python-version: ${{ env[matrix.python-version] }} + architecture: 'x64' + - name: Install tox + run: pip install tox==3.27.1 -U tox-factor + - name: Cache tox environment + # Preserves .tox directory between runs for faster installs + uses: actions/cache@v2 + with: + path: | + .tox + ~/.cache/pip + key: v3-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', + 'dev-requirements.txt') }}-core + - name: Run tox + run: tox -f ${{ matrix.python-version }}-sdk -- -k opentelemetry-sdk/tests/performance/benchmarks --benchmark-json=output.json + - name: Report on SDK benchmark results + uses: benchmark-action/github-action-benchmark@v1 + with: + name: OpenTelemetry Python SDK Benchmarks - Python ${{ env[matrix.python-version ]}} - SDK + tool: pytest + output-file-path: opentelemetry-sdk/tests/output.json + gh-pages-branch: benchmarks + github-token: ${{ secrets.GITHUB_TOKEN }} + # Make a commit on `gh-pages` with benchmarks from previous step + benchmark-data-dir-path: "benchmarks" + auto-push: true + max-items-in-chart: 100 + # Alert with a commit comment on possible performance regression + alert-threshold: '200%' + comment-on-alert: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 88c1675c470..db2aee75ea1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -62,7 +62,7 @@ jobs: if: ${{ matrix.os == 'windows-2019'}} run: git config --system core.longpaths true - name: run tox - run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- --benchmark-json=${{ + run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json # - name: Find and merge benchmarks # id: find_and_merge_benchmarks @@ -159,4 +159,4 @@ jobs: key: v3-tox-cache-${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}-contrib - name: run tox - run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} + run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra diff --git a/docs/getting_started/tests/requirements.txt b/docs/getting_started/tests/requirements.txt new file mode 100644 index 00000000000..c4c62067ac4 --- /dev/null +++ b/docs/getting_started/tests/requirements.txt @@ -0,0 +1,27 @@ +asgiref==3.7.2 +attrs==23.1.0 +certifi==2023.7.22 +charset-normalizer==2.0.12 +click==8.1.7 +Deprecated==1.2.14 +flaky==3.7.0 +Flask==2.0.1 +idna==3.4 +importlib-metadata==6.8.0 +iniconfig==2.0.0 +itsdangerous==2.1.2 +Jinja2==3.1.2 +MarkupSafe==2.1.3 +packaging==23.2 +pluggy==1.3.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +requests==2.26.0 +tomli==2.0.1 +typing_extensions==4.8.0 +urllib3==1.26.18 +Werkzeug==2.3.7 +wrapt==1.15.0 +zipp==3.17.0 diff --git a/exporter/opentelemetry-exporter-jaeger-proto-grpc/pyproject.toml b/exporter/opentelemetry-exporter-jaeger-proto-grpc/pyproject.toml index 131f12a0b4a..7a0c628d366 100644 --- a/exporter/opentelemetry-exporter-jaeger-proto-grpc/pyproject.toml +++ b/exporter/opentelemetry-exporter-jaeger-proto-grpc/pyproject.toml @@ -26,6 +26,7 @@ classifiers = [ "Typing :: Typed", ] dependencies = [ + "protobuf ~= 3.20.0", "googleapis-common-protos ~= 1.52, < 1.60.0", "grpcio >= 1.0.0, < 2.0.0", "opentelemetry-api ~= 1.3", diff --git a/tox.ini b/tox.ini index 4bb52cdc666..e6b8c8aeb5b 100644 --- a/tox.ini +++ b/tox.ini @@ -19,8 +19,7 @@ envlist = pypy3-opentelemetry-semantic-conventions ; docs/getting-started - py3{7,8,9,10,11}-opentelemetry-getting-started - pypy3-opentelemetry-getting-started + py3{8,9,10,11}-opentelemetry-getting-started py3{7,8,9,10,11}-opentelemetry-opentracing-shim pypy3-opentelemetry-opentracing-shim @@ -132,7 +131,7 @@ commands_pre = protobuf: pip install {toxinidir}/opentelemetry-proto - getting-started: pip install requests==2.26.0 flask==2.0.1 + getting-started: pip install -r requirements.txt getting-started: pip install -e "{env:CONTRIB_REPO}#egg=opentelemetry-util-http&subdirectory=util/opentelemetry-util-http" getting-started: pip install -e "{env:CONTRIB_REPO}#egg=opentelemetry-instrumentation&subdirectory=opentelemetry-instrumentation" getting-started: pip install -e "{env:CONTRIB_REPO}#egg=opentelemetry-instrumentation-requests&subdirectory=instrumentation/opentelemetry-instrumentation-requests"