Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 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
11 changes: 10 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:integration-versions

parameters:
coverage:
Expand Down Expand Up @@ -472,6 +472,9 @@ jobs:

test_logging:
<<: *contrib_job
docker:
- image: *ddtrace_dev_image
- *testagent
steps:
- run_test:
pattern: 'test_logging'
Expand Down Expand Up @@ -584,6 +587,9 @@ jobs:

dogpile_cache:
<<: *contrib_job
docker:
- image: *ddtrace_dev_image
- *testagent
steps:
- run_test:
pattern: 'dogpile_cache'
Expand Down Expand Up @@ -770,6 +776,9 @@ jobs:

pytest:
<<: *contrib_job
docker:
- image: *ddtrace_dev_image
- *testagent
steps:
- run_test:
pattern: 'pytest'
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ 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:integration-versions
ports:
- "127.0.0.1:9126:8126"
volumes:
- ./tests/snapshots:/snapshots
environment:
- LOG_LEVEL=WARNING
- LOG_LEVEL=ERROR
- SNAPSHOT_DIR=/snapshots
- SNAPSHOT_CI
- DD_POOL_TRACE_CHECK_FAILURES=true
Expand Down
3 changes: 2 additions & 1 deletion scripts/contrib-patch-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class Test{contrib.title()}Patch(PatchTestCase.Base):
__module_name__ = "{module}"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, {module.replace(".", "_")}):
pass
Expand All @@ -89,7 +90,7 @@ def assert_not_module_double_patched(self, {module.replace(".", "_")}):
def assert_module_implements_get_version(self):
version = get_version()
assert type(version) == str
assert version != ''
assert version != ""
"""
).lstrip()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestAiobotocorePatch(PatchTestCase.Base):
__module_name__ = "aiobotocore.client"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, aiobotocore_client):
pass
Expand Down
1 change: 1 addition & 0 deletions tests/contrib/aiohttp/test_aiohttp_patch_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestAiohttpPatch(PatchTestCase.Base):
__module_name__ = "aiohttp"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, aiohttp):
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestAiohttp_Jinja2Patch(PatchTestCase.Base):
__module_name__ = "aiohttp_jinja2"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, aiohttp_jinja2):
pass
Expand Down
1 change: 1 addition & 0 deletions tests/contrib/aiomysql/test_aiomysql_patch_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestAiomysqlPatch(PatchTestCase.Base):
__module_name__ = "aiomysql"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, aiomysql):
pass
Expand Down
1 change: 1 addition & 0 deletions tests/contrib/aiopg/test_aiopg_patch_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestAiopgPatch(PatchTestCase.Base):
__module_name__ = "aiopg"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, aiopg):
pass
Expand Down
1 change: 1 addition & 0 deletions tests/contrib/aioredis/test_aioredis_patch_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestAioredisPatch(PatchTestCase.Base):
__module_name__ = "aioredis"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, aioredis):
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestAlgoliasearchPatch(PatchTestCase.Base):
__module_name__ = "algoliasearch"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, algoliasearch):
pass
Expand Down
1 change: 1 addition & 0 deletions tests/contrib/aredis/test_aredis_patch_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestAredisPatch(PatchTestCase.Base):
__module_name__ = "aredis"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, aredis):
pass
Expand Down
1 change: 1 addition & 0 deletions tests/contrib/asyncpg/test_asyncpg_patch_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestAsyncpgPatch(PatchTestCase.Base):
__module_name__ = "asyncpg"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, asyncpg):
pass
Expand Down
1 change: 1 addition & 0 deletions tests/contrib/boto/test_boto_patch_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestBotoPatch(PatchTestCase.Base):
__module_name__ = "boto.connection"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, boto_connection):
pass
Expand Down
1 change: 1 addition & 0 deletions tests/contrib/botocore/test_botocore_patch_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestBotocorePatch(PatchTestCase.Base):
__module_name__ = "botocore.client"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, botocore_client):
pass
Expand Down
1 change: 1 addition & 0 deletions tests/contrib/bottle/test_bottle_patch_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestBottlePatch(PatchTestCase.Base):
__module_name__ = "bottle"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, bottle):
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestCassandraPatch(PatchTestCase.Base):
__module_name__ = "cassandra.cluster"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, cassandra_cluster):
pass
Expand Down
3 changes: 3 additions & 0 deletions tests/contrib/celery/test_patch.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import unittest

from ddtrace import Pin
from tests.contrib.patch import emit_integration_and_version_to_test_agent


class CeleryPatchTest(unittest.TestCase):
Expand Down Expand Up @@ -29,3 +30,5 @@ def test_get_version(self):
version = get_version()
assert type(version) == str
assert version != ""

emit_integration_and_version_to_test_agent("celery", version)
3 changes: 3 additions & 0 deletions tests/contrib/cherrypy/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from ddtrace.constants import SAMPLING_PRIORITY_KEY
from ddtrace.contrib.cherrypy import TraceMiddleware
from ddtrace.ext import http
from tests.contrib.patch import emit_integration_and_version_to_test_agent
from tests.utils import TracerTestCase
from tests.utils import assert_span_http_status_code
from tests.utils import snapshot
Expand Down Expand Up @@ -60,6 +61,8 @@ def test_get_version(self):
assert type(version) == str
assert version != ""

emit_integration_and_version_to_test_agent("cherrypy", version)

def test_double_instrumentation(self):
# ensure CherryPy is never instrumented twice when `ddtrace-run`
# and `TraceMiddleware` are used together. `traced_app` MUST
Expand Down
1 change: 1 addition & 0 deletions tests/contrib/consul/test_consul_patch_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestConsulPatch(PatchTestCase.Base):
__module_name__ = "consul"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, consul):
pass
Expand Down
1 change: 1 addition & 0 deletions tests/contrib/django/test_django_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class TestDjangoPatch(PatchTestCase.Base):
__module_name__ = "django"
__patch_func__ = patch
__unpatch_func__ = None
__get_version__ = get_version

def assert_module_patched(self, django):
import django.apps.registry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestDogpile_CachePatch(PatchTestCase.Base):
__module_name__ = "dogpile.cache"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, dogpile_cache):
pass
Expand Down
13 changes: 13 additions & 0 deletions tests/contrib/elasticsearch/test_elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
from ddtrace import Pin
from ddtrace import config
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
from ddtrace.contrib.elasticsearch.patch import get_version
from ddtrace.contrib.elasticsearch.patch import get_versions
from ddtrace.contrib.elasticsearch.patch import patch
from ddtrace.contrib.elasticsearch.patch import unpatch
from ddtrace.ext import http
from ddtrace.internal.schema import DEFAULT_SPAN_SERVICE_NAME
from tests.contrib.patch import emit_integration_and_version_to_test_agent
from tests.utils import TracerTestCase

from ..config import ELASTICSEARCH_CONFIG
Expand Down Expand Up @@ -331,3 +334,13 @@ def test_large_body(self):
self.reset()
assert len(spans) == 1
assert len(spans[0].get_tag("elasticsearch.body")) < 25000

def test_and_emit_get_version(self):
version = get_version()
assert type(version) == str
assert version == ""

versions = get_versions()
assert len(versions) > 0
for module_name, v in versions.items():
emit_integration_and_version_to_test_agent(module_name, v)
1 change: 1 addition & 0 deletions tests/contrib/falcon/test_falcon_patch_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestFalconPatch(PatchTestCase.Base):
__module_name__ = "falcon"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, falcon):
pass
Expand Down
1 change: 1 addition & 0 deletions tests/contrib/fastapi/test_fastapi_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class TestFastapiPatch(PatchTestCase.Base):
__module_name__ = "fastapi"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, fastapi):
self.assert_wrapped(fastapi.applications.FastAPI.build_middleware_stack)
Expand Down
1 change: 1 addition & 0 deletions tests/contrib/flask/test_flask_patch_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestFlaskPatch(PatchTestCase.Base):
__module_name__ = "flask"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, flask):
pass
Expand Down
6 changes: 6 additions & 0 deletions tests/contrib/futures/test_futures_patch_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# 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.contrib.futures import get_version
from ddtrace.contrib.futures.patch import patch


Expand All @@ -17,6 +19,7 @@ class TestFuturesPatch(PatchTestCase.Base):
__module_name__ = "concurrent.futures.thread"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, concurrent_futures):
pass
Expand All @@ -29,3 +32,6 @@ def assert_not_module_double_patched(self, concurrent_futures):

def assert_module_implements_get_version(self):
pass

def test_and_emit_get_version(self):
pass
3 changes: 2 additions & 1 deletion tests/contrib/gevent/test_gevent_patch_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestGeventPatch(PatchTestCase.Base):
__module_name__ = "gevent"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, gevent):
pass
Expand All @@ -32,4 +33,4 @@ def assert_not_module_double_patched(self, gevent):
def assert_module_implements_get_version(self):
version = get_version()
assert type(version) == str
assert version != ''
assert version != ""
1 change: 1 addition & 0 deletions tests/contrib/graphql/test_graphql_patch_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestGraphqlPatch(PatchTestCase.Base):
__module_name__ = "graphql"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, graphql):
pass
Expand Down
1 change: 1 addition & 0 deletions tests/contrib/grpc/test_grpc_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class TestGRPCPatch(PatchTestCase.Base):
__module_name__ = "grpc"
__patch_func__ = patch
__unpatch_func__ = None
__get_version__ = get_version

def assert_module_patched(self, grpc):
# Client Wrapping
Expand Down
8 changes: 6 additions & 2 deletions tests/contrib/httplib/test_httplib_patch.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from ddtrace.contrib.httplib.patch import get_version
from ddtrace.contrib.httplib.patch import patch
from ddtrace.internal.compat import PY2

Expand All @@ -14,6 +15,7 @@ class TestHttplibPatch(PatchTestCase.Base):
__module_name__ = "httplib" if PY2 else "http.client"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, http_client):
pass
Expand All @@ -24,5 +26,7 @@ def assert_not_module_patched(self, http_client):
def assert_not_module_double_patched(self, http_client):
pass

def assert_module_implements_get_version(self):
pass
def test_and_emit_get_version(self):
version = get_version()
assert type(version) == str
assert version == ""
1 change: 1 addition & 0 deletions tests/contrib/httpx/test_httpx_patch_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestHttpxPatch(PatchTestCase.Base):
__module_name__ = "httpx"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, httpx):
pass
Expand Down
1 change: 1 addition & 0 deletions tests/contrib/jinja2/test_jinja2_patch_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestJinja2Patch(PatchTestCase.Base):
__module_name__ = "jinja2"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, jinja2):
pass
Expand Down
1 change: 1 addition & 0 deletions tests/contrib/kafka/test_kafka_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class TestKafkaPatch(PatchTestCase.Base):
__module_name__ = "confluent_kafka"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, confluent_kafka):
self.assert_wrapped(confluent_kafka.Producer({}).produce)
Expand Down
1 change: 1 addition & 0 deletions tests/contrib/kombu/test_kombu_patch_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestKombuPatch(PatchTestCase.Base):
__module_name__ = "kombu"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, kombu):
pass
Expand Down
1 change: 1 addition & 0 deletions tests/contrib/langchain/test_langchain_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class TestLangchainPatch(PatchTestCase.Base):
__module_name__ = "langchain"
__patch_func__ = patch
__unpatch_func__ = unpatch
__get_version__ = get_version

def assert_module_patched(self, langchain):
self.assert_wrapped(langchain.llms.base.BaseLLM.generate)
Expand Down
Loading