Skip to content

Commit bdd7048

Browse files
authored
chore(ci): migrate tracer tests to riot [backport #5504 to 1.12] (#5727)
Backport #5504 to 1.12. This PR does a few things: - Replaces hypothesis testing in `tests.tracer.test_http.py` with a static text file containing the same examples previously used by hypothesis, to get around the riot incompatibility with Python 3.11 in importing `hypothesis.provisional`. - Since there is no issue now with the tracer test suites and riot, the `test_http.py` test command has now been removed from tox and the tracer test suite is fully migrated back into riot. ## Checklist - [x] Change(s) are motivated and described in the PR description. - [x] Testing strategy is described if automated tests are not included in the PR. - [x] Risk is outlined (performance impact, potential for breakage, maintainability, etc). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/contributing.html#Release-Note-Guidelines) are followed. - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)). - [x] PR description includes explicit acknowledgement/acceptance of the performance implications of this PR as reported in the benchmarks PR comment. ## Reviewer Checklist - [x] Title is accurate. - [x] No unnecessary changes are introduced. - [x] Description motivates each change. - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes unless absolutely necessary. - [x] Testing strategy adequately addresses listed risk(s). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] Release note makes sense to a user of the library. - [x] Reviewer has explicitly acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment.
1 parent 7f79631 commit bdd7048

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1544
-483
lines changed

.circleci/config.yml

Lines changed: 5 additions & 169 deletions
Original file line numberDiff line numberDiff line change
@@ -68,37 +68,12 @@ commands:
6868
- store_artifacts:
6969
path: coverage
7070

71-
setup_tox:
72-
description: "Install tox"
73-
steps:
74-
- run: pip install -U "tox<4"
75-
7671
setup_riot:
7772
description: "Install riot"
7873
steps:
7974
# Make sure we install and run riot on Python 3
8075
- run: pip3 install riot==0.17.2
8176

82-
restore_tox_cache:
83-
description: "Restore .tox directory from previous runs for faster installs"
84-
steps:
85-
- restore_cache:
86-
# In the cache key:
87-
# - .Environment.CIRCLE_JOB: We do separate tox environments by job name, so caching and restoring is
88-
# much faster.
89-
key: tox-cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "tox.ini" }}-{{ checksum "setup.py" }}
90-
91-
save_tox_cache:
92-
description: "Save .tox directory into cache for faster installs next time"
93-
steps:
94-
- save_cache:
95-
# In the cache key:
96-
# - .Environment.CIRCLE_JOB: We do separate tox environments by job name, so caching and restoring is
97-
# much faster.
98-
key: tox-cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "tox.ini" }}-{{ checksum "setup.py" }}
99-
paths:
100-
- ".tox"
101-
10277
save_pip_cache:
10378
description: "Save pip cache directory"
10479
steps:
@@ -196,27 +171,6 @@ commands:
196171
- store_artifacts:
197172
path: test-results
198173

199-
run_tox_scenario:
200-
description: "Run scripts/run-tox-scenario with setup, caching and persistence"
201-
parameters:
202-
pattern:
203-
type: string
204-
store_coverage:
205-
type: boolean
206-
default: true
207-
steps:
208-
- checkout
209-
- setup_tox
210-
- restore_tox_cache
211-
- run:
212-
name: "Run scripts/run-tox-scenario"
213-
command: scripts/run-tox-scenario '<< parameters.pattern >>'
214-
- save_tox_cache
215-
- store_test_results:
216-
path: test-results
217-
- store_artifacts:
218-
path: test-results
219-
220174
executors:
221175
cimg_base:
222176
docker:
@@ -381,10 +335,6 @@ jobs:
381335
steps:
382336
- run_test:
383337
pattern: "tracer"
384-
- run_tox_scenario:
385-
# Riot venvs break with Py 3.11 importlib, specifically with hypothesis (test_http.py).
386-
# We skip the test_http.py tests in riot and run the test_http.py tests through tox.
387-
pattern: '^py.\+-tracer_test_http'
388338

389339
ci_visibility:
390340
<<: *contrib_job_small
@@ -427,114 +377,16 @@ jobs:
427377
pattern: 'opentelemetry'
428378
snapshot: true
429379

430-
# Building gevent (for which we never want wheels because they crash)
431-
# on Python 2.7 requires Microsoft Visual C++ 9.0 which is not installed. :(
432-
# which is not installed.
433-
# profile-windows-27:
434-
# executor:
435-
# name: win/default
436-
# shell: bash.exe
437-
# # This is the number of tox envs for this job
438-
# parallelism: 4
439-
# steps:
440-
# - run: choco install python2
441-
# - run_tox_scenario:
442-
# store_coverage: false
443-
# pattern: '^py27-profile'
444-
445-
profile-windows-35:
446-
executor:
447-
name: win/default
448-
shell: bash.exe
449-
# This is the number of tox envs for this job
450-
parallelism: 4
451-
steps:
452-
- run: choco install -y python --version=3.5.4 --side-by-side
453-
- run_tox_scenario:
454-
store_coverage: false
455-
pattern: '^py35-profile'
456-
457-
profile-windows-36:
458-
executor:
459-
name: win/default
460-
shell: bash.exe
461-
# This is the number of tox envs for this job
462-
parallelism: 4
463-
steps:
464-
- run: choco install -y python --version=3.6.8 --side-by-side
465-
- run_tox_scenario:
466-
store_coverage: false
467-
pattern: '^py36-profile'
468-
469-
# For whatever reason, choco does not install Python 3.7 correctly on Windows
470-
# profile-windows-37:
471-
# executor:
472-
# name: win/default
473-
# shell: bash.exe
474-
# # This is the number of tox envs for this job
475-
# parallelism: 5
476-
# steps:
477-
# - run: choco install python --version=3.7.9
478-
# - run_tox_scenario:
479-
# store_coverage: false
480-
# pattern: '^py37-profile'
481-
482-
# This requires the machine to reboot :(
483-
# profile-windows-38:
484-
# executor:
485-
# name: win/default
486-
# shell: bash.exe
487-
# # This is the number of tox envs for this job
488-
# parallelism: 5
489-
# steps:
490-
# - run: choco install -y python --version=3.8.10 --side-by-side
491-
# - run_tox_scenario:
492-
# store_coverage: false
493-
# pattern: '^py38-profile'
494-
495-
# This requires the machine to reboot :(
496-
# profile-windows-39:
497-
# executor:
498-
# name: win/default
499-
# shell: bash.exe
500-
# # This is the number of tox envs for this job
501-
# parallelism: 5
502-
# steps:
503-
# - run: choco install -y python --version=3.9.12 --side-by-side
504-
# - run_tox_scenario:
505-
# store_coverage: false
506-
# pattern: '^py39-profile'
507-
508-
profile-windows-310:
509-
executor:
510-
name: win/default
511-
shell: bash.exe
512-
# This is the number of tox envs for this job
513-
parallelism: 5
514-
steps:
515-
# circleci/[email protected] orb includes python 3.10.6
516-
- run_tox_scenario:
517-
store_coverage: false
518-
pattern: '^py310-profile'
519-
520-
profile-windows-311:
521-
executor:
522-
name: win/default
523-
shell: bash.exe
524-
steps:
525-
- run: choco install -y python --version=3.11.0 --side-by-side
526-
- run_tox_scenario:
527-
store_coverage: false
528-
pattern: '^py311-profile'
529-
530380
profile:
531381
<<: *contrib_job
532382
resource_class: large
533-
parallelism: 15
383+
# There are 32 jobs, so 2 per-node
384+
parallelism: 16
534385
steps:
535-
- run_tox_scenario:
386+
- run_test:
536387
store_coverage: false
537-
pattern: '^py.\+-profile'
388+
# We don't want to run the profile-diff venvs
389+
pattern: 'profile$'
538390

539391
integration_agent:
540392
<<: *machine_executor
@@ -1235,14 +1087,6 @@ requires_tests: &requires_tests
12351087
- urllib3
12361088
- vertica
12371089
- wsgi
1238-
# - profile-windows-27
1239-
# - profile-windows-35
1240-
# - profile-windows-36
1241-
# - profile-windows-37
1242-
# - profile-windows-38
1243-
# - profile-windows-39
1244-
# - profile-windows-310
1245-
# - profile-windows-311
12461090

12471091
workflows:
12481092
version: 2
@@ -1341,13 +1185,5 @@ workflows:
13411185
- urllib3: *requires_base_venvs
13421186
- vertica: *requires_base_venvs
13431187
- wsgi: *requires_base_venvs
1344-
# - profile-windows-27: *requires_pre_check
1345-
# - profile-windows-35: *requires_pre_check
1346-
# - profile-windows-36: *requires_pre_check
1347-
# - profile-windows-37: *requires_pre_check
1348-
# - profile-windows-38: *requires_pre_check
1349-
# - profile-windows-39: *requires_pre_check
1350-
# - profile-windows-310: *requires_pre_check
1351-
# - profile-windows-311: *requires_pre_check
13521188
# Final reports
13531189
- coverage_report: *requires_tests

.riot/requirements/102cf0a.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.7
3+
# by the following command:
4+
#
5+
# pip-compile --no-annotate --resolver=backtracking .riot/requirements/102cf0a.in
6+
#
7+
attrs==23.1.0
8+
coverage[toml]==7.2.3
9+
exceptiongroup==1.1.1
10+
gevent==1.4.0
11+
greenlet==0.4.14
12+
gunicorn[gevent]==20.1.0
13+
hypothesis==6.45.0
14+
importlib-metadata==6.6.0
15+
iniconfig==2.0.0
16+
mock==5.0.2
17+
opentracing==2.4.0
18+
packaging==23.1
19+
pluggy==1.0.0
20+
py-cpuinfo==8.0.0
21+
pytest==7.3.1
22+
pytest-asyncio==0.21.0
23+
pytest-benchmark==4.0.0
24+
pytest-cov==4.0.0
25+
pytest-mock==3.10.0
26+
sortedcontainers==2.4.0
27+
tomli==2.0.1
28+
typing-extensions==4.5.0
29+
uwsgi==2.0.21
30+
zipp==3.15.0
31+
32+
# The following packages are considered to be unsafe in a requirements file:
33+
# setuptools

.riot/requirements/10625b5.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.11
3+
# by the following command:
4+
#
5+
# pip-compile --no-annotate --resolver=backtracking .riot/requirements/10625b5.in
6+
#
7+
attrs==23.1.0
8+
coverage[toml]==7.2.3
9+
gunicorn==20.1.0
10+
hypothesis==6.45.0
11+
iniconfig==2.0.0
12+
mock==5.0.2
13+
opentracing==2.4.0
14+
packaging==23.1
15+
pluggy==1.0.0
16+
protobuf==4.22.3
17+
py-cpuinfo==8.0.0
18+
pytest==7.3.1
19+
pytest-asyncio==0.21.0
20+
pytest-benchmark==4.0.0
21+
pytest-cov==4.0.0
22+
pytest-mock==3.10.0
23+
sortedcontainers==2.4.0
24+
tenacity==8.2.2
25+
uwsgi==2.0.21
26+
27+
# The following packages are considered to be unsafe in a requirements file:
28+
# setuptools

.riot/requirements/6a3e012.txt renamed to .riot/requirements/10bb56b.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This file is autogenerated by pip-compile
33
# To update, run:
44
#
5-
# pip-compile --no-annotate .riot/requirements/6a3e012.in
5+
# pip-compile --no-annotate .riot/requirements/10bb56b.in
66
#
77
attrs==22.1.0
88
coverage==5.5

.riot/requirements/9dad804.txt renamed to .riot/requirements/12b8829.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@
22
# This file is autogenerated by pip-compile with Python 3.10
33
# by the following command:
44
#
5-
# pip-compile --no-annotate --resolver=backtracking .riot/requirements/9dad804.in
5+
# pip-compile --no-annotate --resolver=backtracking .riot/requirements/12b8829.in
66
#
7-
attrs==22.2.0
8-
coverage[toml]==7.2.2
7+
attrs==23.1.0
8+
coverage[toml]==7.2.3
99
exceptiongroup==1.1.1
1010
hypothesis==6.45.0
1111
iniconfig==2.0.0
12-
mock==5.0.1
12+
mock==5.0.2
1313
msgpack==1.0.5
1414
opentracing==2.4.0
15-
packaging==23.0
15+
packaging==23.1
1616
pluggy==1.0.0
17-
py==1.11.0
1817
py-cpuinfo==8.0.0
19-
pytest==7.2.2
18+
pytest==7.3.1
2019
pytest-benchmark==4.0.0
2120
pytest-cov==4.0.0
2221
pytest-mock==3.10.0

.riot/requirements/139c624.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.8
3+
# by the following command:
4+
#
5+
# pip-compile --no-annotate --resolver=backtracking .riot/requirements/139c624.in
6+
#
7+
attrs==23.1.0
8+
coverage[toml]==7.2.3
9+
exceptiongroup==1.1.1
10+
gevent==20.6.1
11+
greenlet==0.4.16
12+
gunicorn[gevent]==20.1.0
13+
hypothesis==6.45.0
14+
iniconfig==2.0.0
15+
mock==5.0.2
16+
opentracing==2.4.0
17+
packaging==23.1
18+
pluggy==1.0.0
19+
py-cpuinfo==8.0.0
20+
pytest==7.3.1
21+
pytest-asyncio==0.21.0
22+
pytest-benchmark==4.0.0
23+
pytest-cov==4.0.0
24+
pytest-mock==3.10.0
25+
sortedcontainers==2.4.0
26+
tomli==2.0.1
27+
uwsgi==2.0.21
28+
zope-event==4.6
29+
zope-interface==6.0
30+
31+
# The following packages are considered to be unsafe in a requirements file:
32+
# setuptools

.riot/requirements/14e4d18.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.9
3+
# by the following command:
4+
#
5+
# pip-compile --no-annotate --resolver=backtracking .riot/requirements/14e4d18.in
6+
#
7+
attrs==23.1.0
8+
coverage[toml]==7.2.3
9+
exceptiongroup==1.1.1
10+
gunicorn==20.1.0
11+
hypothesis==6.45.0
12+
iniconfig==2.0.0
13+
mock==5.0.2
14+
opentracing==2.4.0
15+
packaging==23.1
16+
pluggy==1.0.0
17+
protobuf==4.22.3
18+
py-cpuinfo==8.0.0
19+
pytest==7.3.1
20+
pytest-asyncio==0.21.0
21+
pytest-benchmark==4.0.0
22+
pytest-cov==4.0.0
23+
pytest-mock==3.10.0
24+
sortedcontainers==2.4.0
25+
tenacity==8.2.2
26+
tomli==2.0.1
27+
uwsgi==2.0.21
28+
29+
# The following packages are considered to be unsafe in a requirements file:
30+
# setuptools

0 commit comments

Comments
 (0)