aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2020-01-20 17:59:30 -0800
committerZac Medico <zmedico@gentoo.org>2020-01-20 18:35:43 -0800
commite5878170638a091db1331df7e7922c8a14e29e86 (patch)
tree10ee18e95937d65101a6bb640395f6145005ab71
parenttravis.yml: drop pypy and python 3.5 (diff)
downloadportage-e5878170638a091db1331df7e7922c8a14e29e86.tar.gz
portage-e5878170638a091db1331df7e7922c8a14e29e86.tar.bz2
portage-e5878170638a091db1331df7e7922c8a14e29e86.zip
Add unit test which demonstrates bug 705986
This USE suggestion appears to prevent application of || preference adjustment to solve the cycle (pypy-exe-bin would solve it): * Error: circular dependencies: (dev-python/pypy-exe-7.3.0:7.3.0/7.3.0::test_repo, ebuild scheduled for merge) depends on (dev-python/pypy-7.3.0:0/73::test_repo, ebuild scheduled for merge) (buildtime) (dev-python/pypy-exe-7.3.0:7.3.0/7.3.0::test_repo, ebuild scheduled for merge) (buildtime) It might be possible to break this cycle by applying the following change: - dev-python/pypy-exe-7.3.0 (Change USE: +low-memory) Meanwhile, an explicit pypy-exe-bin argument adjusts the || preference and breaks the cycle: $ emerge -pq pypy pypy-exe-bin [ebuild N ] dev-python/pypy-exe-bin-7.3.0 [ebuild N ] dev-python/pypy-7.3.0 Bug: https://bugs.gentoo.org/705986 Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r--lib/portage/tests/resolver/test_circular_choices.py48
1 files changed, 48 insertions, 0 deletions
diff --git a/lib/portage/tests/resolver/test_circular_choices.py b/lib/portage/tests/resolver/test_circular_choices.py
index a5c10b476..968677a46 100644
--- a/lib/portage/tests/resolver/test_circular_choices.py
+++ b/lib/portage/tests/resolver/test_circular_choices.py
@@ -160,3 +160,51 @@ class VirtualCircularChoicesTestCase(TestCase):
self.assertEqual(test_case.test_success, True, test_case.fail_msg)
finally:
playground.cleanup()
+
+
+class CircularPypyExeTestCase(TestCase):
+ def testCircularPypyExe(self):
+
+ ebuilds = {
+ 'dev-python/pypy-7.3.0': {
+ 'EAPI': '7',
+ 'SLOT' : '0/73',
+ 'DEPEND': '|| ( dev-python/pypy-exe dev-python/pypy-exe-bin )'
+ },
+ 'dev-python/pypy-exe-7.3.0': {
+ 'EAPI': '7',
+ 'IUSE': 'low-memory',
+ 'SLOT' : '7.3.0',
+ 'BDEPEND': '!low-memory? ( dev-python/pypy )'
+ },
+ 'dev-python/pypy-exe-bin-7.3.0': {
+ 'EAPI': '7',
+ 'SLOT' : '7.3.0',
+ },
+ }
+
+ test_cases = (
+ # Demonstrate bug 705986, where a USE change suggestion is given
+ # even though an || preference adjustment is available.
+ ResolverPlaygroundTestCase(
+ ['dev-python/pypy'],
+ circular_dependency_solutions = {'dev-python/pypy-7.3.0': {frozenset({('low-memory', True)})}},
+ success = False,
+ ),
+ # Demonstrate explicit pypy-exe-bin argument used as a workaround
+ # for bug 705986.
+ ResolverPlaygroundTestCase(
+ ['dev-python/pypy', 'dev-python/pypy-exe-bin'],
+ mergelist=['dev-python/pypy-exe-bin-7.3.0', 'dev-python/pypy-7.3.0'],
+ success = True,
+ ),
+ )
+
+ playground = ResolverPlayground(ebuilds=ebuilds, debug=False)
+ try:
+ for test_case in test_cases:
+ playground.run_TestCase(test_case)
+ self.assertEqual(test_case.test_success, True, test_case.fail_msg)
+ finally:
+ playground.debug = False
+ playground.cleanup()