Skip to content

Commit

Permalink
Merge branch 'main' into munir/bump-lib-datadog
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdinur authored Feb 26, 2025
2 parents 32c8740 + acba519 commit d1d287c
Show file tree
Hide file tree
Showing 27 changed files with 2,078 additions and 383 deletions.
34 changes: 30 additions & 4 deletions .github/workflows/test_frameworks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
DD_TESTING_RAISE: true
CMAKE_BUILD_PARALLEL_LEVEL: 12
DD_DEBUGGER_EXPL_OUTPUT_FILE: debugger-expl.txt
DD_BYTECODE_INJECTION_OUTPUT_FILE: bytecode-injection.txt

defaults:
run:
Expand All @@ -74,7 +75,7 @@ jobs:
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
if: needs.needs-run.outputs.outcome == 'success'
with:
python-version: '3.9'
python-version: '3.10'
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
if: needs.needs-run.outputs.outcome == 'success'
with:
Expand Down Expand Up @@ -110,6 +111,14 @@ jobs:
- name: Debugger exploration result
if: needs.needs-run.outputs.outcome == 'success'
run: cat debugger-expl.txt
- name: Run Bytecode injection tests
if: needs.needs-run.outputs.outcome == 'success'
# Disable all test_simple tests because they check for
# log output and it contains phony error messages.
run: PYTHONPATH=../ddtrace/tests/internal/bytecode_injection/framework_injection/ ddtrace-run pytest test --continue-on-collection-errors -v -k 'not test_simple'
- name: Bytecode injection result
if: needs.needs-run.outputs.outcome == 'success'
run: cat bytecode-injection.txt

django-testsuite:
strategy:
Expand Down Expand Up @@ -164,7 +173,7 @@ jobs:
DD_DEBUGGER_EXPL_COVERAGE_DELETE_LINE_PROBES: 1 # Delete to speed up
DD_DEBUGGER_EXPL_CONSERVATIVE: 1
DD_DEBUGGER_EXPL_OUTPUT_FILE: debugger-expl.txt
PYTHONPATH: ../ddtrace/tests/debugging/exploration/:.
DD_BYTECODE_INJECTION_OUTPUT_FILE: bytecode-injection.txt
CMAKE_BUILD_PARALLEL_LEVEL: 12
defaults:
run:
Expand Down Expand Up @@ -228,12 +237,21 @@ jobs:
- name: Run tests
if: needs.needs-run.outputs.outcome == 'success'
# django.tests.requests module interferes with requests library patching in the tracer -> disable requests patch
run: DD_PATCH_MODULES=unittest:no DD_TRACE_REQUESTS_ENABLED=0 ddtrace-run tests/runtests.py --parallel 1
run: PYTHONPATH=../ddtrace/tests/debugging/exploration/:. DD_PATCH_MODULES=unittest:no DD_TRACE_REQUESTS_ENABLED=0 ddtrace-run tests/runtests.py --parallel 1

- name: Debugger exploration results
if: needs.needs-run.outputs.outcome == 'success'
run: cat debugger-expl.txt

- name: Run Bytecode injection tests
if: needs.needs-run.outputs.outcome == 'success'
# django.tests.requests module interferes with requests library patching in the tracer -> disable requests patch
run: PYTHONPATH=../ddtrace/tests/internal/bytecode_injection/framework_injection/:. DD_PATCH_MODULES=unittest:no DD_TRACE_REQUESTS_ENABLED=0 ddtrace-run tests/runtests.py --parallel 1

- name: Bytecode injection results
if: needs.needs-run.outputs.outcome == 'success'
run: cat bytecode-injection.txt

graphene-testsuite-3_0:
strategy:
matrix:
Expand Down Expand Up @@ -334,14 +352,15 @@ jobs:
DD_APPSEC_ENABLED: ${{ matrix.appsec }}
CMAKE_BUILD_PARALLEL_LEVEL: 12
DD_DEBUGGER_EXPL_OUTPUT_FILE: debugger-expl.txt
DD_BYTECODE_INJECTION_OUTPUT_FILE: bytecode-injection.txt
defaults:
run:
working-directory: fastapi
steps:
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
if: needs.needs-run.outputs.outcome == 'success'
with:
python-version: '3.9'
python-version: '3.10'
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
if: needs.needs-run.outputs.outcome == 'success'
with:
Expand Down Expand Up @@ -373,6 +392,13 @@ jobs:
- name: Debugger exploration results
if: needs.needs-run.outputs.outcome == 'success'
run: cat debugger-expl.txt
- name: Bytecode injection Test
if: needs.needs-run.outputs.outcome == 'success'
# https://github.com/tiangolo/fastapi/pull/10876
run: PYTHONPATH=../ddtrace/tests/internal/bytecode_injection/framework_injection/ ddtrace-run pytest -p no:warnings tests -k 'not test_warn_duplicate_operation_id'
- name: Bytecode injection results
if: needs.needs-run.outputs.outcome == 'success'
run: cat bytecode-injection.txt

flask-testsuite:
strategy:
Expand Down
8 changes: 4 additions & 4 deletions ddtrace/debugging/_function/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
from typing import cast

from ddtrace.debugging._function.discovery import FullyNamed
from ddtrace.internal.injection import HookInfoType
from ddtrace.internal.injection import HookType
from ddtrace.internal.injection import eject_hooks
from ddtrace.internal.injection import inject_hooks
from ddtrace.internal.bytecode_injection import HookInfoType
from ddtrace.internal.bytecode_injection import HookType
from ddtrace.internal.bytecode_injection import eject_hooks
from ddtrace.internal.bytecode_injection import inject_hooks
from ddtrace.internal.wrapping.context import ContextWrappedFunction
from ddtrace.internal.wrapping.context import WrappingContext

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
from bytecode import Bytecode

from ddtrace.internal.assembly import Assembly

from .compat import PYTHON_VERSION_INFO as PY
from ddtrace.internal.compat import PYTHON_VERSION_INFO as PY


HookType = Callable[[Any], Any]
Expand Down
Loading

0 comments on commit d1d287c

Please sign in to comment.