Skip to content

Commit d6d1705

Browse files
authored
Move integration tests to riot (#2967)
This was complicated slightly by a deprecation warning new in Python 3.10 as a result of some features wrapt is using which are slated for removal soon. An issue was created upstream to address since the fix didn't appear to be trivial.
1 parent b9fc5c0 commit d6d1705

File tree

4 files changed

+56
-20
lines changed

4 files changed

+56
-20
lines changed

.circleci/config.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ default_resource_class: &default_resource_class medium
44
cimg_base_image: &cimg_base_image cimg/base:stable
55
python39_image: &python39_image cimg/python:3.9
66
ddtrace_dev_image: &ddtrace_dev_image datadog/dd-trace-py:buster
7-
datadog_agent_image: &datadog_agent_image datadog/agent:latest
87
redis_image: &redis_image redis:4.0-alpine
98
memcached_image: &memcached_image memcached:1.5-alpine
109
cassandra_image: &cassandra_image cassandra:3.11.7
@@ -243,15 +242,6 @@ httpbin_local: &httpbin_local
243242
image: *httpbin_image
244243
name: httpbin.org
245244

246-
datadog_agent: &datadog_agent
247-
image: *datadog_agent_image
248-
environment:
249-
DD_API_KEY: invalid_key_but_this_is_fine
250-
DD_APM_ENABLED: true
251-
DD_APM_RECEIVER_SOCKET: /tmp/ddagent/trace.sock
252-
DD_BIND_HOST: 0.0.0.0
253-
DD_LOG_LEVEL: DEBUG
254-
255245
mysql_server: &mysql_server
256246
image: *mysql_image
257247
environment:
@@ -372,28 +362,38 @@ jobs:
372362
integration_agent5:
373363
<<: *machine_executor
374364
steps:
365+
- attach_workspace:
366+
at: .
375367
- checkout
376368
- run: docker-compose up -d ddagent5
377369
- run:
378370
command: docker-compose logs -f
379371
background: true
380372
- run:
381-
command: ./scripts/ddtest scripts/run-tox-scenario '^py..-integration-v5'
373+
command: |
374+
mv .riot .ddriot
375+
./scripts/ddtest riot -v run --pass-env -s 'integration-v5'
382376
383377
integration_agent:
384378
<<: *machine_executor
385379
steps:
380+
- attach_workspace:
381+
at: .
386382
- checkout
387383
- run: docker-compose up -d ddagent
388384
- run:
389385
command: docker-compose logs -f
390386
background: true
391387
- run:
392-
command: ./scripts/ddtest scripts/run-tox-scenario '^py..-integration-latest'
388+
command: |
389+
mv .riot .ddriot
390+
./scripts/ddtest riot -v run --pass-env -s 'integration-latest'
393391
394392
integration_testagent:
395393
<<: *machine_executor
396394
steps:
395+
- attach_workspace:
396+
at: .
397397
- checkout
398398
- run: SNAPSHOT_CI=1 docker-compose up -d testagent
399399
- run:
@@ -402,7 +402,9 @@ jobs:
402402
- run:
403403
environment:
404404
DD_TRACE_AGENT_URL: http://localhost:9126
405-
command: ./scripts/ddtest scripts/run-tox-scenario '^py..-integration-snapshot'
405+
command: |
406+
mv .riot .ddriot
407+
./scripts/ddtest riot -v run --pass-env -s 'integration-snapshot'
406408
407409
vendor:
408410
<<: *contrib_job_small

riotfile.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,33 @@ def select_pys(min_version=MIN_PYTHON_VERSION, max_version=MAX_PYTHON_VERSION):
207207
)
208208
],
209209
),
210+
Venv(
211+
name="integration",
212+
pys=select_pys(),
213+
command="pytest --no-cov {cmdargs} tests/integration/",
214+
pkgs={"msgpack": [latest]},
215+
venvs=[
216+
Venv(
217+
name="integration-v5",
218+
env={
219+
"AGENT_VERSION": "v5",
220+
},
221+
),
222+
Venv(
223+
name="integration-latest",
224+
env={
225+
"AGENT_VERSION": "latest",
226+
},
227+
),
228+
Venv(
229+
name="integration-snapshot",
230+
env={
231+
"DD_TRACE_AGENT_URL": "http://localhost:9126",
232+
"AGENT_VERSION": "testagent",
233+
},
234+
),
235+
],
236+
),
210237
Venv(
211238
name="runtime",
212239
command="pytest {cmdargs} tests/runtime/",

tests/integration/test_integration.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,4 +783,17 @@ def test_no_warnings():
783783
env["DD_TRACE_SQLITE3_ENABLED"] = "false"
784784
out, err, status, pid = call_program("ddtrace-run", sys.executable, "-Wall", "-c", "'import ddtrace'", env=env)
785785
assert out == b"", out
786-
assert err == b"", err
786+
787+
# Wrapt is using features deprecated in Python 3.10
788+
# See https://github.com/GrahamDumpleton/wrapt/issues/200
789+
if sys.version_info < (3, 10, 0):
790+
assert err == b"", err
791+
else:
792+
assert (
793+
err
794+
== (
795+
b"<frozen importlib._bootstrap>:914: ImportWarning: "
796+
b"ImportHookFinder.find_spec() not found; falling back to find_module()\n"
797+
)
798+
* 75
799+
), err

tox.ini

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ envlist =
2020
wait
2121
{py27,py35,py36,py37,py38,py39,py310}-profile{,-gevent}
2222
{py27,py35,py36,py37,py38,py39,py310}-profile-minreqs{,-gevent}
23-
py{27,35,36,37,38,39,310}-integration-{v5,latest,snapshot}
2423
# Integrations environments
2524
algoliasearch_contrib-py{27,35,36,37,38,39,310}-algoliasearch{1,2,}
2625
asyncio_contrib-py{35,36,37,38,39,310}
@@ -83,9 +82,6 @@ usedevelop = true
8382
setenv =
8483
DD_TESTING_RAISE=1
8584
profile-gevent: DD_PROFILE_TEST_GEVENT=1
86-
integration-v5: AGENT_VERSION=v5
87-
integration-latest: AGENT_VERSION=latest
88-
integration-snapshot: AGENT_VERSION=testagent
8985
bottle_contrib_autopatch: DATADOG_SERVICE_NAME=bottle-app
9086

9187
extras =
@@ -99,7 +95,6 @@ deps =
9995
# test dependencies installed in all envs
10096
mock
10197
# used to test our custom msgpack encoder
102-
integration: msgpack
10398
profile: pytest-benchmark
10499
py{27,35,36,37,38,39}-profile: uwsgi
105100
py{27,35,36,37,38,39}-profile-minreqs: protobuf==3.0.0
@@ -253,7 +248,6 @@ commands =
253248
opentracer_asyncio: pytest {posargs} tests/opentracer/test_tracer_asyncio.py
254249
opentracer_tornado-tornado{40,41,42,43,44}: pytest {posargs} tests/opentracer/test_tracer_tornado.py
255250
opentracer_gevent: pytest {posargs} tests/opentracer/test_tracer_gevent.py
256-
integration-{v5,latest,snapshot}: pytest --no-cov {posargs} tests/integration/
257251
# Contribs
258252
algoliasearch_contrib: pytest {posargs} tests/contrib/algoliasearch
259253
asyncio_contrib: pytest {posargs} tests/contrib/asyncio

0 commit comments

Comments
 (0)