AcademySoftwareFoundation / AcademySoftwareFoundation/rez
setting allow_unversioned_packages=True breaks tests cases
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 369
- Avg merge
- 12d 3h
- Merged PRs (30d)
- 5
Description
Since we do not use unversioned packages, I tried setting `allow_unversioned_packages = False ` in the [rezconfig](https://github.com/nerdvegas/rez/blob/master/src/rez/rezconfig.py#L247) in order to see how much faster is the resolve, but by doing that, it breaks the following test cases :
```ERROR: test_2 (rez.tests.test_packages.TestPackages)
package iteration.
ERROR: test_01 (rez.tests.test_solver.TestSolver)
Extremely basic solves involving a single package.
ERROR: test_02 (rez.tests.test_solver.TestSolver)
Basic solves involving a single package.
ERROR: test_06 (rez.tests.test_solver.TestSolver)
Basic solves involving multiple packages.
ERROR: test_09_version_priority_mode (rez.tests.test_solver.TestSolver)
ERROR: test_10_intersection_priority_mode (rez.tests.test_solver.TestSolver)
ERROR: test_2 (rez.tests.test_suites.TestRezSuites)
Test basic suite.
ERROR: test_3 (rez.tests.test_suites.TestRezSuites)
Test tool clashes in a suite.
```
The traceback in most of the cases is as follows
```
Traceback (most recent call last):
File "/tmp/rez_unit_test_569/packages/rez/2.2.0.1/CentOS-6.2_thru_7/python-2.6/lib/python2.6/site-packages/rez-2.2.0.1-py2.6.egg/rez/tests/test_suites.py", line 100, in test_3
c_foo = ResolvedContext(["foo"])
File "/tmp/rez_unit_test_569/packages/rez/2.2.0.1/CentOS-6.2_thru_7/python-2.6/lib/python2.6/site-packages/rez-2.2.0.1-py2.6.egg/rez/resolved_context.py", line 249, in __init__
resolver.solve()
File "/tmp/rez_unit_test_569/packages/rez/2.2.0.1/CentOS-6.2_thru_7/python-2.6/lib/python2.6/site-packages/rez-2.2.0.1-py2.6.egg/rez/utils/memcached.py", line 243, in wrapper
return func(*nargs, **kwargs)
File "/tmp/rez_unit_test_569/packages/rez/2.2.0.1/CentOS-6.2_thru_7/python-2.6/lib/python2.6/site-packages/rez-2.2.0.1-py2.6.egg/rez/resolver.py", line 116, in solve
solver = self._solve()
File "/tmp/rez_unit_test_569/packages/rez/2.2.0.1/CentOS-6.2_thru_7/python-2.6/lib/python2.6/site-packages/rez-2.2.0.1-py2.6.egg/rez/resolver.py", line 375, in _solve
buf=self.buf)
File "/tmp/rez_unit_test_569/packages/rez/2.2.0.1/CentOS-6.2_thru_7/python-2.6/lib/python2.6/site-packages/rez-2.2.0.1-py2.6.egg/rez/solver.py", line 1829, in __init__
phase = _ResolvePhase(solver=self)
File "/tmp/rez_unit_test_569/packages/rez/2.2.0.1/CentOS-6.2_thru_7/python-2.6/lib/python2.6/site-packages/rez-2.2.0.1-py2.6.egg/rez/solver.py", line 1215, in __init__
scope = _PackageScope(package_request, solver=solver)
File "/tmp/rez_unit_test_569/packages/rez/2.2.0.1/CentOS-6.2_thru_7/python-2.6/lib/python2.6/site-packages/rez-2.2.0.1-py2.6.egg/rez/solver.py", line 1022, in __init__
package_request.name, package_request.range)
File "/tmp/rez_unit_test_569/packages/rez/2.2.0.1/CentOS-6.2_thru_7/python-2.6/lib/python2.6/site-packages/rez-2.2.0.1-py2.6.egg/rez/solver.py", line 2103, in _get_variant_slice
package_name=package_name, range_=range_)
File "/tmp/rez_unit_test_569/packages/rez/2.2.0.1/CentOS-6.2_thru_7/python-2.6/lib/python2.6/site-packages/rez-2.2.0.1-py2.6.egg/rez/solver.py", line 994, in get_variant_slice
variant_list = _PackageVariantList(package_name, self.solver)
File "/tmp/rez_unit_test_569/packages/rez/2.2.0.1/CentOS-6.2_thru_7/python-2.6/lib/python2.6/site-packages/rez-2.2.0.1-py2.6.egg/rez/solver.py", line 543, in __init__
% (package_name, "; ".join(self.solver.package_paths)))
PackageFamilyNotFoundError: package family not found: foo (searched: /tmp/rez_unit_test_569/packages/rez/2.2.0.1/CentOS-6.2_thru_7/python-2.6/lib/python2.6/site-packages/rez-2.2.0.1-py2.6.egg/rez/tests/data/suites/packages)
```
Contributor guide
Research direction
Start with src/rez/rezconfig.py at allow_unversioned_packages and reproduce the failures in rez/tests/test_packages.py, rez/tests/test_solver.py, and rez/tests/test_suites.py with the setting disabled. Compare the failing package lookup and resolution behavior with the default configuration; done means the listed tests pass while unversioned packages remain disallowed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100