Skip to content

Commit bf77376

Browse files
fix(tests): use riot lockfiles [backport #5246 to 1.9] (#5624)
Backport of #5246 to 1.9 This change makes the Riot test suite build its virtual environments using fully-specified dependency tree files that live in source control. ## How to Review 1. Review #5227 and leave your comments on this change, or use [this filtered diff view](https://github.com/DataDog/dd-trace-py/pull/5246/files?file-filters%5B%5D=.py&file-filters%5B%5D=.rst&file-filters%5B%5D=.yml&file-filters%5B%5D=No+extension&file-filters%5B%5D=dotfile&show-deleted-files=true&show-viewed-files=true) ## Why? The computation involved in building the tree of dependencies for a given test virtual environment is not small. By performing that work only when the tree changes rather than on every test run, we make our CI build time shorter. Having the entire dependency tree in source control allows developers to unambiguously understand which versions of nth-order dependencies are in use in a given test environment without needing to run the tests locally, which can make debugging tests easier. Using `riot run -c` to automatically rebuild these requirements files when necessary facilitates future changes like [having a bot rebuild and PR them periodically](https://github.com/DataDog/dd-trace-py/tree/emmett.butler/latest-automation). ## How? By depending on riot==0.17.1, Riot runs on this branch look for requirements lockfiles and create them if they don't exist. That combined with the fact that the repo now contains a lockfile for each venv means that there are no changes necessary to the testing logic itself. This change adds `scripts/compile-and-prune-test-requirements`. That script builds requirements.txt lockfiles for all Riot hashes in the current working tree that don't already have one in `.riot/requirements`. It also deletes such files for Riot hashes that don't exist. In a future change, this script could run under automation, commit its changes, and open pull requests. ## Notes **If you're running tests locally and making changes to the riotfile, you'll need to run `riot` with the `-c` flag to ensure that those changes are reflected in the new dependency trees. You should commit these changes to dependency tree lockfiles and include them in pull requests that change the riotfile.** This change removes the list of latest tested versions in `dependencies.py` as well as the logic that parses that list and uses it in tests. The finding of the latest version is now handled by Riot, which runs `pip-compile` internally. Most of the changes to the riotfile in this diff are either: * workarounds for the fact that versions of `pip-compile` prior to 3.7 don't do "[backtracking](https://pip.pypa.io/en/stable/topics/dependency-resolution/#backtracking)" during dependency resolution * pins to the same versions as in the deleted `dependencies.py` file due to compile or test failures with newer versions ## Risk The main risk I can think of is that this adds some confusion for contributors about how to get riot to notice their venv changes. I've updated the contributor docs accordingly. ## Checklist - [x] Finish riot pull request DataDog/riot#196 - [x] Finish the next riot pull request DataDog/riot#202 - [x] Generate all requirements lockfiles - [x] Fix riotfile to make tests pass on this PR - [x] Move automation changes to separate PR - [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] Author is aware 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 is aware of, and discussed the performance implications of this PR as reported in the benchmarks PR comment. --------- Co-authored-by: Emmett Butler <[email protected]> Co-authored-by: Emmett Butler <[email protected]>
1 parent 343f27c commit bf77376

File tree

1,355 files changed

+41596
-1146
lines changed

Some content is hidden

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

1,355 files changed

+41596
-1146
lines changed

.circleci/dependencies.py

Lines changed: 0 additions & 161 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ ENV/
123123
.vscode/
124124

125125
# Riot
126-
.riot/
126+
.riot/venv*
127+
.riot/requirements/*.in
127128

128129
# Auto-generated version file
129130
ddtrace/_version.py

.riot/requirements/1011db1.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.10
3+
# by the following command:
4+
#
5+
# pip-compile --no-annotate --resolver=backtracking .riot/requirements/1011db1.in
6+
#
7+
aniso8601==9.0.1
8+
attrs==22.2.0
9+
coverage[toml]==7.2.2
10+
exceptiongroup==1.1.1
11+
graphene==3.2.2
12+
graphql-core==3.1.7
13+
graphql-relay==3.1.5
14+
hypothesis==6.45.0
15+
iniconfig==2.0.0
16+
mock==5.0.1
17+
opentracing==2.4.0
18+
packaging==23.0
19+
pluggy==1.0.0
20+
pytest==7.2.2
21+
pytest-asyncio==0.20.3
22+
pytest-cov==4.0.0
23+
pytest-mock==3.10.0
24+
sortedcontainers==2.4.0
25+
tomli==2.0.1

.riot/requirements/1017b7b.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# This file is autogenerated by pip-compile with python 3.6
3+
# To update, run:
4+
#
5+
# pip-compile --no-annotate .riot/requirements/1017b7b.in
6+
#
7+
amqp==2.6.1
8+
attrs==22.2.0
9+
coverage[toml]==6.2
10+
hypothesis==6.31.6
11+
importlib-metadata==4.8.3
12+
iniconfig==1.1.1
13+
kombu==4.0.2
14+
mock==5.0.1
15+
opentracing==2.4.0
16+
packaging==21.3
17+
pluggy==1.0.0
18+
py==1.11.0
19+
pyparsing==3.0.9
20+
pytest==7.0.1
21+
pytest-cov==4.0.0
22+
pytest-mock==3.6.1
23+
sortedcontainers==2.4.0
24+
tomli==1.2.3
25+
typing-extensions==4.1.1
26+
vine==1.3.0
27+
zipp==3.6.0

.riot/requirements/1018a90.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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/1018a90.in
6+
#
7+
attrs==22.2.0
8+
coverage[toml]==7.2.2
9+
exceptiongroup==1.1.1
10+
hypothesis==6.45.0
11+
iniconfig==2.0.0
12+
mock==5.0.1
13+
opentracing==2.4.0
14+
packaging==23.0
15+
pluggy==1.0.0
16+
pytest==7.2.2
17+
pytest-cov==4.0.0
18+
pytest-mock==3.10.0
19+
redis==3.0.1
20+
redis-py-cluster==2.0.0
21+
sortedcontainers==2.4.0
22+
tomli==2.0.1

.riot/requirements/10192c8.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#
2+
# This file is autogenerated by pip-compile with python 3.6
3+
# To update, run:
4+
#
5+
# pip-compile --no-annotate .riot/requirements/10192c8.in
6+
#
7+
attrs==22.2.0
8+
coverage[toml]==6.2
9+
hypothesis==6.31.6
10+
importlib-metadata==4.8.3
11+
iniconfig==1.1.1
12+
mako==1.1.6
13+
markupsafe==2.0.1
14+
mock==5.0.1
15+
opentracing==2.4.0
16+
packaging==21.3
17+
pluggy==1.0.0
18+
py==1.11.0
19+
pyparsing==3.0.9
20+
pytest==7.0.1
21+
pytest-cov==4.0.0
22+
pytest-mock==3.6.1
23+
sortedcontainers==2.4.0
24+
tomli==1.2.3
25+
typing-extensions==4.1.1
26+
zipp==3.6.0

.riot/requirements/10212ca.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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/10212ca.in
6+
#
7+
attrs==22.2.0
8+
coverage[toml]==7.2.2
9+
exceptiongroup==1.1.1
10+
googleapis-common-protos==1.58.0
11+
grpcio==1.51.3
12+
hypothesis==6.45.0
13+
importlib-metadata==6.0.0
14+
iniconfig==2.0.0
15+
mock==5.0.1
16+
opentracing==2.4.0
17+
packaging==23.0
18+
pluggy==1.0.0
19+
protobuf==4.22.1
20+
pytest==7.2.2
21+
pytest-asyncio==0.20.3
22+
pytest-cov==4.0.0
23+
pytest-mock==3.10.0
24+
sortedcontainers==2.4.0
25+
tomli==2.0.1
26+
typing-extensions==4.5.0
27+
zipp==3.15.0

.riot/requirements/102421e.txt

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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/102421e.in
6+
#
7+
attrs==22.2.0
8+
aws-sam-translator==1.62.0
9+
aws-xray-sdk==2.11.0
10+
boto==2.49.0
11+
boto3==1.26.92
12+
botocore==1.29.92
13+
certifi==2022.12.7
14+
cffi==1.15.1
15+
cfn-lint==0.53.1
16+
charset-normalizer==3.1.0
17+
coverage[toml]==7.2.2
18+
cryptography==39.0.2
19+
docker==6.0.1
20+
ecdsa==0.14.1
21+
exceptiongroup==1.1.1
22+
hypothesis==6.45.0
23+
idna==2.10
24+
iniconfig==2.0.0
25+
jinja2==2.11.3
26+
jmespath==1.0.1
27+
jsondiff==2.0.0
28+
jsonpatch==1.32
29+
jsonpointer==2.3
30+
jsonschema==3.2.0
31+
junit-xml==1.9
32+
markupsafe==1.1.1
33+
mock==5.0.1
34+
more-itertools==9.1.0
35+
moto==1.3.16
36+
networkx==2.8.8
37+
opentracing==2.4.0
38+
packaging==23.0
39+
pluggy==1.0.0
40+
pyasn1==0.4.8
41+
pycparser==2.21
42+
pydantic==1.10.6
43+
pynamodb==5.4.1
44+
pyrsistent==0.19.3
45+
pytest==7.2.2
46+
pytest-cov==4.0.0
47+
pytest-mock==3.10.0
48+
python-dateutil==2.8.2
49+
python-jose[cryptography]==3.3.0
50+
pytz==2022.7.1
51+
pyyaml==6.0
52+
requests==2.28.2
53+
responses==0.23.1
54+
rsa==4.9
55+
s3transfer==0.6.0
56+
six==1.16.0
57+
sortedcontainers==2.4.0
58+
sshpubkeys==3.3.1
59+
tomli==2.0.1
60+
types-pyyaml==6.0.12.8
61+
typing-extensions==4.5.0
62+
urllib3==1.26.15
63+
websocket-client==1.5.1
64+
werkzeug==2.1.2
65+
wrapt==1.15.0
66+
xmltodict==0.13.0
67+
zipp==3.15.0
68+
69+
# The following packages are considered to be unsafe in a requirements file:
70+
# setuptools

0 commit comments

Comments
 (0)