Skip to content

Commit 057a1dc

Browse files
committed
readme
1 parent d7721ad commit 057a1dc

File tree

1 file changed

+39
-15
lines changed

1 file changed

+39
-15
lines changed

scripts/populate_tox/README.md

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,6 @@ a number of releases in between:
2323
- If the package doesn't have multiple majors, we pick two versions in between
2424
lowest and highest.
2525

26-
27-
### How to add a test suite
28-
29-
1. Add the minimum supported version of the framework/library to `_MIN_VERSIONS`
30-
in `integrations/__init__.py`. This should be the lowest version of the
31-
framework that we can guarantee works with the SDK. If you've just added the
32-
integration, it's fine to set this to the latest version of the framework
33-
at the time.
34-
2. Add the integration and any constraints to `TEST_SUITE_CONFIG`. See below
35-
for the format (or copy-paste one of the existing entries).
36-
3. Add the integration to one of the groups in the `GROUPS` dictionary in
37-
`scripts/split_tox_gh_actions/split_tox_gh_actions.py`.
38-
4. Add the `TESTPATH` for the test suite in `tox.jinja`'s `setenv` section.
39-
5. Run `scripts/generate-test-files.sh` and commit the changes.
40-
4126
#### Caveats
4227

4328
- Make sure the integration name is the same everywhere. If it consists of
@@ -109,3 +94,42 @@ you can say:
10994
},
11095
},
11196
```
97+
98+
## How-Tos
99+
100+
### Add a new test suite
101+
102+
1. Add the minimum supported version of the framework/library to `_MIN_VERSIONS`
103+
in `integrations/__init__.py`. This should be the lowest version of the
104+
framework that we can guarantee works with the SDK. If you've just added the
105+
integration, it's fine to set this to the latest version of the framework
106+
at the time.
107+
2. Add the integration and any constraints to `TEST_SUITE_CONFIG`. See below
108+
for the format (or copy-paste one of the existing entries).
109+
3. Add the integration to one of the groups in the `GROUPS` dictionary in
110+
`scripts/split_tox_gh_actions/split_tox_gh_actions.py`.
111+
4. Add the `TESTPATH` for the test suite in `tox.jinja`'s `setenv` section.
112+
5. Run `scripts/generate-test-files.sh` and commit the changes.
113+
114+
### Migrate a test suite to populate_tox.py
115+
116+
A handful of integration test suites are still hardcoded. The goal is to migrate
117+
them all to `populate_tox.py` over time.
118+
119+
1. Remove the integration from the `IGNORE` list in `populate_tox.py`.
120+
2. Remove the hardcoded entries for the integration from the `envlist` and `deps` sections of `tox.jinja`.
121+
2. Run `scripts/generate-test-files.sh`.
122+
3. Run the test suite, either locally or by creating a PR.
123+
4. Address any test failures that happen.
124+
125+
You might have to introduce additional version bounds on the dependencies of the
126+
package. Try to determine the source of the failure and address it.
127+
128+
Common scenarios:
129+
- An old version of the tested package installs a dependency without defining
130+
an upper version bound on it. A new version of the dependency is installed that
131+
is incompatible with the package. In this case you need to determine which
132+
version of the dependency don't contain the breaking change and restrict this
133+
in `TEST_SUITE_CONFIG`.
134+
- Tests are failing on an old Python version. In this case double-check whether
135+
we were even testing them on that version in the original `tox.ini`.

0 commit comments

Comments
 (0)