commit:     8b9345976c95ff41c7f075f7917d498f77d7d155
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 30 22:18:35 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Aug 30 22:38:42 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=8b934597

test_slot_conflict_rebuild: Add dev-lang/go case for bug 439688

Demonstrate this unwanted dev-lang/go rebuild triggered by a missed
update due to a slot conflict:

[ebuild   R    ] dev-lang/go-1.14.7

WARNING: One or more updates/rebuilds have been skipped due to a dependency 
conflict:

dev-lang/go:0

  (dev-lang/go-1.15:0/1.15::test_repo, ebuild scheduled for merge) USE="" 
conflicts with
    =dev-lang/go-1.14* required by (net-p2p/syncthing-1.3.4-r1:0/0::test_repo, 
installed) USE=""
    ^            ^^^^^

Bug: https://bugs.gentoo.org/439688
Bug: https://bugs.gentoo.org/739648
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 .../tests/resolver/test_slot_conflict_rebuild.py   | 64 +++++++++++++++++++++-
 1 file changed, 63 insertions(+), 1 deletion(-)

diff --git a/lib/portage/tests/resolver/test_slot_conflict_rebuild.py 
b/lib/portage/tests/resolver/test_slot_conflict_rebuild.py
index 95b6396ba..b3bcf44d0 100644
--- a/lib/portage/tests/resolver/test_slot_conflict_rebuild.py
+++ b/lib/portage/tests/resolver/test_slot_conflict_rebuild.py
@@ -1,4 +1,4 @@
-# Copyright 2012-2014 Gentoo Foundation
+# Copyright 2012-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase
@@ -453,3 +453,65 @@ class SlotConflictRebuildTestCase(TestCase):
                                self.assertEqual(test_case.test_success, True, 
test_case.fail_msg)
                finally:
                        playground.cleanup()
+
+class SlotConflictRebuildGolangTestCase(TestCase):
+
+       def testSlotConflictRebuildGolang(self):
+               self.todo = True
+
+               ebuilds = {
+
+                       "dev-lang/go-1.14.7" : {
+                               "EAPI": "7",
+                               "SLOT": "0/1.14.7"
+                       },
+
+                       "dev-lang/go-1.15" : {
+                               "EAPI": "7",
+                               "SLOT": "0/1.15"
+                       },
+
+                       "net-p2p/syncthing-1.3.4-r1" : {
+                               "EAPI": "7",
+                               "BDEPEND": "=dev-lang/go-1.14* 
>=dev-lang/go-1.12"
+                       },
+
+               }
+
+               installed = {
+
+                       "dev-lang/go-1.14.7" : {
+                               "EAPI": "7",
+                               "SLOT": "0/1.14.7"
+                       },
+
+                       "net-p2p/syncthing-1.3.4-r1" : {
+                               "EAPI": "7",
+                               "BDEPEND": "=dev-lang/go-1.14* 
>=dev-lang/go-1.12"
+                       },
+
+               }
+
+               world = ["dev-lang/go", "net-p2p/syncthing"]
+
+               test_cases = (
+
+                       # Demonstrate an unwanted dev-lang/go rebuild triggered 
by a missed
+                       # update due to a slot conflict (bug #439688).
+                       ResolverPlaygroundTestCase(
+                               ["@world"],
+                               options = {"--update": True, "--deep": True},
+                               success = True,
+                               mergelist = []),
+
+               )
+
+               playground = ResolverPlayground(ebuilds=ebuilds,
+                       installed=installed, world=world, 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()

Reply via email to