Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
d7aa03a
test
wconti27 Sep 5, 2023
81d0c09
add default region
wconti27 Sep 5, 2023
3e8c2ca
change
wconti27 Sep 6, 2023
80937b8
fix precheck
wconti27 Sep 6, 2023
f0f765e
initial commit trying new way of getting integration and version
wconti27 Sep 6, 2023
ec90abf
reformat PR
wconti27 Sep 11, 2023
1d42e96
fix import errors from python 2
wconti27 Sep 11, 2023
096a5a0
fix py2.7 errors
wconti27 Sep 11, 2023
0c10cda
fix some more tests
wconti27 Sep 11, 2023
84a0431
fix some tests
wconti27 Sep 11, 2023
8878069
fix lint
wconti27 Sep 11, 2023
4bd9dda
fix remaining failures
wconti27 Sep 11, 2023
6d176df
add depencency name to request
wconti27 Oct 2, 2023
7be9143
Merge branch '2.x' into conti/test-integration-versions-branch-2
wconti27 Oct 2, 2023
a0029d7
fix lint
wconti27 Oct 2, 2023
f8a5307
change to error logging
wconti27 Oct 2, 2023
237a5aa
back to debug logging
wconti27 Oct 2, 2023
baca681
fix failing tests
wconti27 Oct 2, 2023
9eabbb5
store tested versions as artifacts
wconti27 Oct 4, 2023
c0c69ed
Merge branch '2.x' into conti/test-integration-versions-branch-2
wconti27 Oct 4, 2023
c7b78a2
add store artifacts
wconti27 Oct 5, 2023
a39b034
change log level back to debug
wconti27 Oct 5, 2023
59d8228
fix according to reviewer comments
wconti27 Oct 6, 2023
55cd6a4
dont run if resp body is empty
wconti27 Oct 6, 2023
66baa8a
fix script
wconti27 Oct 6, 2023
a571265
Merge branch '2.x' into conti/test-integration-versions-branch-2
wconti27 Oct 6, 2023
5235195
Merge branch '2.x' into conti/test-integration-versions-branch-2
wconti27 Oct 10, 2023
925b185
fix elasticsearch
wconti27 Oct 10, 2023
831b489
update elasticsearch dependency name
wconti27 Oct 10, 2023
85e1bb8
Merge branch '2.x' into conti/test-integration-versions-branch-2
wconti27 Oct 11, 2023
a61de75
update test agent image
wconti27 Oct 11, 2023
84ed39d
test again
wconti27 Oct 11, 2023
bc61ae8
Merge branch '2.x' into conti/test-integration-versions-branch-2
wconti27 Oct 12, 2023
fdf8492
update riotfile to run pyramid generated tests
wconti27 Oct 12, 2023
8c1165d
Merge branch '2.x' into conti/test-integration-versions-branch-2
wconti27 Oct 12, 2023
647e635
change file names
wconti27 Oct 12, 2023
46917a5
update test agent images
wconti27 Oct 12, 2023
69c4524
fix according to reviewer comments
wconti27 Oct 16, 2023
99ed2f3
more fixes
wconti27 Oct 16, 2023
c2ffcf4
fix file name
wconti27 Oct 16, 2023
30d4050
fix lint
wconti27 Oct 16, 2023
c03cf5f
fix tests
wconti27 Oct 16, 2023
b26b69a
Merge branch '2.x' into conti/test-integration-versions-branch-2
wconti27 Oct 16, 2023
8e3b663
Merge branch '2.x' into conti/test-integration-versions-branch-2
wconti27 Oct 16, 2023
4065011
Merge branch 'conti/test-integration-versions-branch-2' of github.com…
wconti27 Oct 16, 2023
b2d4ce4
clean up bash code
wconti27 Oct 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .circleci/config.templ.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mongo_image: &mongo_image mongo:3.6@sha256:19c11a8f1064fd2bb713ef1270f79a742a184
httpbin_image: &httpbin_image kennethreitz/httpbin@sha256:2c7abc4803080c22928265744410173b6fea3b898872c01c5fd0f0f9df4a59fb
vertica_image: &vertica_image sumitchawla/vertica:latest
rabbitmq_image: &rabbitmq_image rabbitmq:3.7-alpine
testagent_image: &testagent_image ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.11.0
testagent_image: &testagent_image docker.io/williamconti549/dd-apm-test-agent:aws-version-table

parameters:
coverage:
Expand Down Expand Up @@ -238,6 +238,9 @@ testagent: &testagent
- DD_POOL_TRACE_CHECK_FAILURES=true
- DD_DISABLE_ERROR_RESPONSES=true
- ENABLED_CHECKS=trace_content_length,trace_stall,meta_tracer_version_header,trace_count_header,trace_peer_service,trace_dd_service
- AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
- AWS_DEFAULT_REGION=us-east-1

jobs:
pre_check:
Expand Down
7 changes: 5 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,21 @@ services:
volumes:
- ddagent:/tmp/ddagent:rw
testagent:
image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.11.0
image: docker.io/williamconti549/dd-apm-test-agent:aws-version-table
ports:
- "127.0.0.1:9126:8126"
volumes:
- ./tests/snapshots:/snapshots
environment:
- LOG_LEVEL=WARNING
- LOG_LEVEL=DEBUG
- SNAPSHOT_DIR=/snapshots
- SNAPSHOT_CI
- DD_POOL_TRACE_CHECK_FAILURES=true
- DD_DISABLE_ERROR_RESPONSES=true
- ENABLED_CHECKS=trace_content_length,trace_stall,meta_tracer_version_header,trace_count_header,trace_peer_service,trace_dd_service
- AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
- AWS_DEFAULT_REGION=us-east-1
vertica:
image: sumitchawla/vertica
environment:
Expand Down
12 changes: 12 additions & 0 deletions tests/contrib/cherrypy/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ def test_get_version(self):
assert type(version) == str
assert version != ""

def emit_integration_and_tested_version_telemetry_event(self):
# emits a telemetry event that will be consumed by the Test Agent and sent to metabase describing
# the integration and its tested versions
from ddtrace._monkey import PATCH_MODULES
from ddtrace.contrib.cherrypy import get_version
from ddtrace.internal.telemetry import telemetry_writer

version = get_version()
telemetry_writer.add_integration("cherrypy", True, PATCH_MODULES.get("cherrypy") is True, "", version=version)
integrations = telemetry_writer._flush_integrations_queue()
telemetry_writer._app_integrations_changed_event(integrations)

def test_double_instrumentation(self):
# ensure CherryPy is never instrumented twice when `ddtrace-run`
# and `TraceMiddleware` are used together. `traced_app` MUST
Expand Down
12 changes: 11 additions & 1 deletion tests/contrib/falcon/test_falcon_patch_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
# script. If you want to make changes to it, you should make sure that you have
# removed the ``_generated`` suffix from the file name, to prevent the content
# from being overwritten by future re-generations.

from ddtrace._monkey import PATCH_MODULES
from ddtrace.contrib.falcon import get_version
from ddtrace.contrib.falcon.patch import patch
from ddtrace.internal.telemetry import telemetry_writer


try:
Expand Down Expand Up @@ -33,3 +34,12 @@ def assert_module_implements_get_version(self):
version = get_version()
assert type(version) == str
assert version != ""

def emit_integration_and_tested_version_telemetry_event(self):
# emits a telemetry event that will be consumed by the Test Agent and sent to metabase describing
# the integration and its tested versions

version = get_version()
telemetry_writer.add_integration("falcon", True, PATCH_MODULES.get("falcon") is True, "", version=version)
integrations = telemetry_writer._flush_integrations_queue()
telemetry_writer._app_integrations_changed_event(integrations)
11 changes: 11 additions & 0 deletions tests/contrib/mysqldb/test_mysqldb_patch_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
# removed the ``_generated`` suffix from the file name, to prevent the content
# from being overwritten by future re-generations.

from ddtrace._monkey import PATCH_MODULES
from ddtrace.contrib.mysqldb import get_version
from ddtrace.contrib.mysqldb.patch import patch
from ddtrace.internal.telemetry import telemetry_writer


try:
Expand Down Expand Up @@ -33,3 +35,12 @@ def assert_module_implements_get_version(self):
version = get_version()
assert type(version) == str
assert version != ""

def emit_integration_and_tested_version_telemetry_event(self):
# emits a telemetry event that will be consumed by the Test Agent and sent to metabase describing
# the integration and its tested versions

version = get_version()
telemetry_writer.add_integration("falcon", True, PATCH_MODULES.get("falcon") is True, "", version=version)
integrations = telemetry_writer._flush_integrations_queue()
telemetry_writer._app_integrations_changed_event(integrations)
12 changes: 12 additions & 0 deletions tests/contrib/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@ def assert_module_implements_get_version(self):
"""
raise NotImplementedError(self.assert_module_implements_get_version.__doc__)

def emit_integration_and_tested_version_telemetry_event(self):
"""
Module patch should implement get_version returning the str version
"""
raise NotImplementedError(self.emit_integration_and_tested_version_telemetry_event.__doc__)

@raise_if_no_attrs
def test_import_patch(self):
"""
Expand All @@ -328,6 +334,12 @@ def test_get_version(self):
"""
self.assert_module_implements_get_version()

def test_integration_and_version(self):
"""
Module patch should implement get_version returning the str version
"""
self.emit_integration_and_tested_version_telemetry_event()

@raise_if_no_attrs
def test_patch_import(self):
"""
Expand Down