test_merge_order: test solve blocker no-overlap
authorZac Medico <zmedico@gentoo.org>
Sat, 21 May 2011 22:15:42 +0000 (15:15 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 26 May 2011 03:47:55 +0000 (20:47 -0700)
pym/portage/tests/resolver/test_merge_order.py

index 62d16d98bfb57eec57e618143502440b23570d4e..bae9bcadb5cb815b686bf536f528f6d65d8e9a3b 100644 (file)
@@ -17,6 +17,9 @@ class MergeOrderTestCase(TestCase):
                                "EAPI"   : "2",
                                "DEPEND" : "!!app-misc/installed-blocker-a",
                        },
+                       "app-misc/blocker-update-order-a-1" : {
+                               "RDEPEND" : ">=app-misc/installed-old-version-blocks-a-2"
+                       },
                        "app-misc/blocker-runtime-a-1" : {},
                        "app-misc/blocker-runtime-hard-a-1" : {},
                        "app-misc/circ-buildtime-a-0": {},
@@ -81,6 +84,10 @@ class MergeOrderTestCase(TestCase):
                                "DEPEND" : "!app-misc/blocker-buildtime-a",
                                "RDEPEND" : "!app-misc/blocker-runtime-a !!app-misc/blocker-runtime-hard-a",
                        },
+                       "app-misc/installed-old-version-blocks-a-1" : {
+                               "RDEPEND" : "!app-misc/installed-old-version-blocks-a",
+                       },
+                       "app-misc/installed-old-version-blocks-a-2" : {},
                        "app-misc/some-app-a-1": {
                                "RDEPEND": "app-misc/circ-runtime-a app-misc/circ-runtime-b",
                        },
@@ -109,6 +116,9 @@ class MergeOrderTestCase(TestCase):
                                "DEPEND" : "!app-misc/blocker-buildtime-a",
                                "RDEPEND" : "!app-misc/blocker-runtime-a !!app-misc/blocker-runtime-hard-a",
                        },
+                       "app-misc/installed-old-version-blocks-a-1" : {
+                               "RDEPEND" : "!app-misc/installed-old-version-blocks-a",
+                       },
                }
 
                test_cases = (
@@ -163,6 +173,15 @@ class MergeOrderTestCase(TestCase):
                                ["app-misc/blocker-buildtime-a"],
                                success = True,
                                mergelist = ["app-misc/blocker-buildtime-a-1"]),
+                       # We're installing a package that an old version of
+                       # an installed package blocks. However, an update is
+                       # available to the old package. The old package should
+                       # be updated first, in order to solve the blocker without
+                       # any need for blocking packages to temporarily overlap.
+                       ResolverPlaygroundTestCase(
+                               ["app-misc/blocker-update-order-a"],
+                               success = True,
+                               mergelist = ["app-misc/installed-old-version-blocks-a-2", "app-misc/blocker-update-order-a-1"]),
                        # installed package has runtime blocker that
                        # should cause it to be uninstalled
                        # TODO: distinguish between install/uninstall tasks in mergelist
@@ -171,7 +190,10 @@ class MergeOrderTestCase(TestCase):
                                success = True,
                                mergelist = ["app-misc/blocker-runtime-a-1", "app-misc/installed-blocker-a-1", "!app-misc/blocker-runtime-a"]),
                        # We have a soft buildtime blocker against an installed
-                       # package that should cause it to be uninstalled.
+                       # package that should cause it to be uninstalled. Note that with
+                       # soft blockers, the blocking packages are allowed to temporarily
+                       # overlap. This allows any essential programs/libraries provided
+                       # by both packages to be available at all times.
                        # TODO: distinguish between install/uninstall tasks in mergelist
                        ResolverPlaygroundTestCase(
                                ["app-misc/blocker-buildtime-unbuilt-a"],