AcademySoftwareFoundation / AcademySoftwareFoundation/rez

add 'permutations' to 'tests' package.py attrib

Open
#1,081 0 comments 0 reactions 0 assignees View on GitHub
enhancement rez-test
Dominant language
Python
Stars
1.1k
Forks
374
Avg merge
9d 12h
Merged PRs (30d)
5

Description

We've hit a case where we'd like to have a test run against multiple python versions, but the package doesn't have (or need) variants. The only way to do this currently is to introduce redundancy and define multiple tests, with differing py version in each test's `requires` param.

We could instead add a new `permutations` field, like so:

```
tests = {
"unit": {
"command": "...",
"permutations": [
{ "py2": { "requires": ["python-2"]} },
{ "py3": { "requires": ["python-3"]} },
]
}
}
```

This would expand the list of tests out to two in this case - `unit.py2` and `unit.py3`. The dict in each permutation is usedto update the test, so in this case the test "requires" field is different in each test.

Contributor guide

Open the contributing guide

Research direction

Start by locating the package.py handling for the tests attribute and the code that expands test definitions. Trace how requires is applied to individual tests, then determine how named permutations should produce tests such as unit.py2 and unit.py3. Done means the permutations example expands into separate tests with the per-permutation requires values.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.