public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2020-08-03 23:28 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2020-08-03 23:28 UTC (permalink / raw
  To: gentoo-commits

commit:     e0ca1855bc60925f56f625737afe117317b3278c
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  3 22:43:21 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug  3 23:28:04 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e0ca1855

lib/portage/tests/resolver/test_old_dep_chain_display.py: fix whitespace

Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/test_old_dep_chain_display.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/portage/tests/resolver/test_old_dep_chain_display.py b/lib/portage/tests/resolver/test_old_dep_chain_display.py
index 8aedf5999..7ab21e8e9 100644
--- a/lib/portage/tests/resolver/test_old_dep_chain_display.py
+++ b/lib/portage/tests/resolver/test_old_dep_chain_display.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase
@@ -8,8 +8,8 @@ class OldDepChainDisplayTestCase(TestCase):
 
 	def testOldDepChainDisplay(self):
 		ebuilds = {
-			"dev-libs/A-1": { "DEPEND": "foo? ( dev-libs/B[-bar] )", "IUSE": "+foo", "EAPI": "2" }, 
-			"dev-libs/A-2": { "DEPEND": "foo? ( dev-libs/C )", "IUSE": "+foo", "EAPI": "1" }, 
+			"dev-libs/A-1": { "DEPEND": "foo? ( dev-libs/B[-bar] )", "IUSE": "+foo", "EAPI": "2" },
+			"dev-libs/A-2": { "DEPEND": "foo? ( dev-libs/C )", "IUSE": "+foo", "EAPI": "1" },
 			"dev-libs/B-1": { "IUSE": "bar", "DEPEND": "!bar? ( dev-libs/D[-baz] )", "EAPI": "2" },
 			"dev-libs/C-1": { "KEYWORDS": "~x86" },
 			"dev-libs/D-1": { "IUSE": "+baz", "EAPI": "1" },


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2024-05-26 18:58 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2024-05-26 18:58 UTC (permalink / raw
  To: gentoo-commits

commit:     ff22b5bf954574f1fad789fc148945d67c3a1215
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 26 18:57:38 2024 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 26 18:57:58 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ff22b5bf

test_tar_merge_order.py: Fix unused pytest unused-import

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/test_tar_merge_order.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/portage/tests/resolver/test_tar_merge_order.py b/lib/portage/tests/resolver/test_tar_merge_order.py
index 4bd9b4df4a..c66d01ee31 100644
--- a/lib/portage/tests/resolver/test_tar_merge_order.py
+++ b/lib/portage/tests/resolver/test_tar_merge_order.py
@@ -2,7 +2,6 @@
 # Distributed under the terms of the GNU General Public License v2
 
 import os
-import pytest
 
 from portage.tests import TestCase
 from portage.tests.resolver.ResolverPlayground import (


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2024-05-26 18:48 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2024-05-26 18:48 UTC (permalink / raw
  To: gentoo-commits

commit:     11bded10a2a4f143e8d7f8ccb2f91f2b6fed59b5
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun May 26 14:44:56 2024 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 26 18:27:02 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=11bded10

tests: add testcase for app-arch/tar merge order with binpkgs

In the bug, dilfridge reports releng@ is hitting the following:
```
$ emerge -epvk world | grep -E "(app-arch/tar|sys-apps/acl)"
[ebuild  N     ] sys-apps/acl-2.3.2-r1::gentoo  USE="nls -static-libs" 363 KiB
[binary   R    ] app-arch/tar-1.35-1::gentoo  USE="acl* nls* xattr* -minimal (-selinux) -verify-sig" 0 KiB
[...]
```

Test for bug #922629 where binary app-arch/tar[acl] was merged
before its dependency sys-apps/acl (with virtual/acl merged but
unsatisfied).

It (appears to be) a bad interaction with @system containing app-alternatives/tar
plus a circular dependency on app-arch/tar. The USE change is also important,
as e.g. dropping "sys-apps/attr nls" from package.use makes things okay.

XFAIL'd for now.

Bug: https://bugs.gentoo.org/922629
Signed-off-by: Sam James <sam <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1332
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/meson.build             |   1 +
 lib/portage/tests/resolver/test_tar_merge_order.py | 495 +++++++++++++++++++++
 2 files changed, 496 insertions(+)

diff --git a/lib/portage/tests/resolver/meson.build b/lib/portage/tests/resolver/meson.build
index 8892c78131..ea948982e7 100644
--- a/lib/portage/tests/resolver/meson.build
+++ b/lib/portage/tests/resolver/meson.build
@@ -81,6 +81,7 @@ py.install_sources(
         'test_slot_operator_update_probe_parent_downgrade.py',
         'test_solve_non_slot_operator_slot_conflicts.py',
         'test_targetroot.py',
+        'test_tar_merge_order.py',
         'test_unmerge_order.py',
         'test_unnecessary_slot_upgrade.py',
         'test_update.py',

diff --git a/lib/portage/tests/resolver/test_tar_merge_order.py b/lib/portage/tests/resolver/test_tar_merge_order.py
new file mode 100644
index 0000000000..7e1a18bc21
--- /dev/null
+++ b/lib/portage/tests/resolver/test_tar_merge_order.py
@@ -0,0 +1,495 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+import os
+import pytest
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (
+    ResolverPlayground,
+    ResolverPlaygroundTestCase,
+)
+
+
+class TarMergeOrderTestCase(TestCase):
+    @pytest.mark.xfail(reason="bug #922629 isn't yet fixed")
+    def testTarMergeOrder(self):
+        """
+        Test for bug #922629 where binary app-arch/tar[acl] was merged
+        before its dependency sys-apps/acl (with virtual/acl merged but
+        unsatisfied).
+
+        It poorly interacted with @system containing app-alternatives/tar
+        as a circular dependency on app-arch/tar.
+        """
+
+        ebuilds = {
+            "app-alternatives/tar-0-1": {
+                "EAPI": "8",
+                "RDEPEND": """
+                    !<app-arch/tar-1.34-r2
+                    gnu? ( >=app-arch/tar-1.34-r2 )
+                    libarchive? ( app-arch/libarchive )
+                """,
+                "IUSE": "+gnu libarchive",
+                "REQUIRED_USE": "^^ ( gnu libarchive )",
+            },
+            "app-arch/libarchive-3.7.4": {"EAPI": "8"},
+            "app-arch/tar-1.35": {
+                "EAPI": "8",
+                "RDEPEND": """
+                    acl? ( virtual/acl )
+                """,
+                "DEPEND": """
+                    acl? ( virtual/acl )
+                    xattr? ( sys-apps/attr )
+                """,
+                "BDEPEND": """
+                    nls? ( sys-devel/gettext )
+                """,
+                "IUSE": "acl nls xattr",
+            },
+            "virtual/acl-0-r2": {
+                "EAPI": "8",
+                "RDEPEND": ">=sys-apps/acl-2.2.52-r1",
+            },
+            "sys-devel/gettext-0.22.4": {
+                "EAPI": "8",
+                "RDEPEND": """
+                    acl? ( virtual/acl )
+                    xattr? ( sys-apps/attr )
+                """,
+                "DEPEND": """
+                    acl? ( virtual/acl )
+                    xattr? ( sys-apps/attr )
+                """,
+                "IUSE": "acl nls xattr",
+            },
+            "sys-apps/attr-2.5.2-r1": {
+                "EAPI": "8",
+                "BDEPEND": "nls? ( sys-devel/gettext )",
+                "IUSE": "nls",
+            },
+            "sys-apps/acl-2.3.2-r1": {
+                "EAPI": "8",
+                "DEPEND": ">=sys-apps/attr-2.4.47-r1",
+                "RDEPEND": ">=sys-apps/attr-2.4.47-r1",
+                "BDEPEND": "nls? ( sys-devel/gettext )",
+                "IUSE": "nls",
+            },
+        }
+
+        installed = {
+            "app-alternatives/tar-0-1": {
+                "EAPI": "8",
+                "RDEPEND": """
+                    !<app-arch/tar-1.34-r2
+                    gnu? ( >=app-arch/tar-1.34-r2 )
+                    libarchive? ( app-arch/libarchive )
+                """,
+                "IUSE": "+gnu libarchive",
+                "USE": "gnu",
+                "REQUIRED_USE": "^^ ( gnu libarchive )",
+            },
+            "app-arch/tar-1.35": {
+                "EAPI": "8",
+                "RDEPEND": """
+                    acl? ( virtual/acl )
+                """,
+                "DEPEND": """
+                    acl? ( virtual/acl )
+                    xattr? ( sys-apps/attr )
+                """,
+                "BDEPEND": """
+                    nls? ( sys-devel/gettext )
+                """,
+                "IUSE": "acl nls xattr",
+                "USE": "",
+            },
+            "sys-devel/gettext-0.22.4": {
+                "EAPI": "8",
+                "RDEPEND": """
+                    acl? ( virtual/acl )
+                    xattr? ( sys-apps/attr )
+                """,
+                "DEPEND": """
+                    acl? ( virtual/acl )
+                    xattr? ( sys-apps/attr )
+                """,
+                "IUSE": "acl nls xattr",
+                "USE": "xattr",
+            },
+            "sys-apps/attr-2.5.2-r1": {
+                "EAPI": "8",
+                "BDEPEND": "nls? ( sys-devel/gettext )",
+                "IUSE": "nls",
+                "USE": "",
+            },
+        }
+
+        binpkgs = {
+            "app-alternatives/tar-0-1": {
+                "EAPI": "8",
+                "RDEPEND": """
+                    !<app-arch/tar-1.34-r2
+                    gnu? ( >=app-arch/tar-1.34-r2 )
+                    libarchive? ( app-arch/libarchive )
+                """,
+                "IUSE": "+gnu libarchive",
+                "USE": "gnu",
+                "REQUIRED_USE": "^^ ( gnu libarchive )",
+            },
+            "app-arch/tar-1.35": {
+                "EAPI": "8",
+                "RDEPEND": """
+                    acl? ( virtual/acl )
+                """,
+                "DEPEND": """
+                    acl? ( virtual/acl )
+                    xattr? ( sys-apps/attr )
+                """,
+                "BDEPEND": """
+                    nls? ( sys-devel/gettext )
+                """,
+                "IUSE": "acl nls xattr",
+                "USE": "acl nls xattr",
+            },
+            "virtual/acl-0-r2": {
+                "EAPI": "8",
+                "RDEPEND": ">=sys-apps/acl-2.2.52-r1",
+            },
+            "sys-devel/gettext-0.22.4": {
+                "EAPI": "8",
+                "RDEPEND": """
+                    acl? ( virtual/acl )
+                    xattr? ( sys-apps/attr )
+                """,
+                "DEPEND": """
+                    acl? ( virtual/acl )
+                    xattr? ( sys-apps/attr )
+                """,
+                "IUSE": "acl nls xattr",
+                "USE": "acl nls xattr",
+            },
+            "sys-apps/attr-2.5.2-r1": {
+                "EAPI": "8",
+                "BDEPEND": "nls? ( sys-devel/gettext )",
+                "IUSE": "nls",
+                "USE": "nls",
+            },
+        }
+
+        world = []
+
+        user_config = {
+            "package.use": (
+                "app-arch/tar acl nls xattr",
+                "sys-apps/acl nls",
+                "sys-apps/attr nls",
+                "sys-devel/gettext acl nls xattr",
+            ),
+        }
+
+        playground = ResolverPlayground(
+            ebuilds=ebuilds,
+            installed=installed,
+            binpkgs=binpkgs,
+            world=world,
+            user_config=user_config,
+        )
+        settings = playground.settings
+        profile_path = settings.profile_path
+
+        # Add app-alternatives/tar to @system too
+        with open(os.path.join(profile_path, "packages"), "w") as f:
+            f.writelines(["*app-alternatives/tar\n", "*app-arch/tar\n"])
+        test_cases = (
+            # Check without binpkgs first
+            ResolverPlaygroundTestCase(
+                ["@world"],
+                success=True,
+                options={"--emptytree": True},
+                mergelist=[
+                    "sys-apps/acl-2.3.2-r1",
+                    "virtual/acl-0-r2",
+                    "sys-apps/attr-2.5.2-r1",
+                    "sys-devel/gettext-0.22.4",
+                    "app-arch/tar-1.35",
+                    "app-alternatives/tar-0",
+                ],
+            ),
+            # In the bug, only --emptytree was broken, so check
+            # some cases without it.
+            ResolverPlaygroundTestCase(
+                ["@world"],
+                success=True,
+                options={
+                    "--usepkg": True,
+                },
+                mergelist=[
+                    "sys-apps/acl-2.3.2-r1",
+                    "[binary]virtual/acl-0-r2",
+                    "[binary]app-arch/tar-1.35",
+                    "[binary]app-alternatives/tar-0",
+                ],
+            ),
+            ResolverPlaygroundTestCase(
+                ["app-arch/tar"],
+                success=True,
+                options={
+                    "--oneshot": True,
+                    "--usepkg": True,
+                },
+                mergelist=[
+                    "sys-apps/acl-2.3.2-r1",
+                    "[binary]virtual/acl-0-r2",
+                    "[binary]app-arch/tar-1.35",
+                ],
+            ),
+            # binpkg --emptytree case which broke
+            ResolverPlaygroundTestCase(
+                ["@world"],
+                success=True,
+                options={
+                    "--emptytree": True,
+                    "--usepkg": True,
+                },
+                mergelist=[
+                    "[binary]sys-apps/attr-2.5.2-r1",
+                    "[binary]virtual/acl-0-r2",
+                    "[binary]sys-devel/gettext-0.22.4",
+                    "sys-apps/acl-2.3.2-r1",
+                    "[binary]app-arch/tar-1.35",
+                    "[binary]app-alternatives/tar-0",
+                ],
+            ),
+        )
+
+        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.cleanup()
+
+    def testTarMergeOrderWithoutAlternatives(self):
+        """
+        Variant of test for bug #922629 where binary app-arch/tar[acl] was merged
+        before its dependency sys-apps/acl (with virtual/acl merged but
+        unsatisfied).
+
+        This variant lacks the problematic app-alternatives/tar to check we handle
+        the simpler case correctly.
+        """
+
+        ebuilds = {
+            "app-arch/tar-1.35": {
+                "EAPI": "8",
+                "RDEPEND": """
+                    acl? ( virtual/acl )
+                """,
+                "DEPEND": """
+                    acl? ( virtual/acl )
+                    xattr? ( sys-apps/attr )
+                """,
+                "BDEPEND": """
+                    nls? ( sys-devel/gettext )
+                """,
+                "IUSE": "acl nls xattr",
+            },
+            "virtual/acl-0-r2": {
+                "EAPI": "8",
+                "RDEPEND": ">=sys-apps/acl-2.2.52-r1",
+            },
+            "sys-devel/gettext-0.22.4": {
+                "EAPI": "8",
+                "RDEPEND": """
+                    acl? ( virtual/acl )
+                    xattr? ( sys-apps/attr )
+                """,
+                "DEPEND": """
+                    acl? ( virtual/acl )
+                    xattr? ( sys-apps/attr )
+                """,
+                "IUSE": "acl nls xattr",
+            },
+            "sys-apps/attr-2.5.2-r1": {
+                "EAPI": "8",
+                "BDEPEND": "nls? ( sys-devel/gettext )",
+                "IUSE": "nls",
+            },
+            "sys-apps/acl-2.3.2-r1": {
+                "EAPI": "8",
+                "DEPEND": ">=sys-apps/attr-2.4.47-r1",
+                "RDEPEND": ">=sys-apps/attr-2.4.47-r1",
+                "BDEPEND": "nls? ( sys-devel/gettext )",
+                "IUSE": "nls",
+            },
+        }
+
+        installed = {
+            "app-arch/tar-1.35": {
+                "EAPI": "8",
+                "RDEPEND": """
+                    acl? ( virtual/acl )
+                """,
+                "DEPEND": """
+                    acl? ( virtual/acl )
+                    xattr? ( sys-apps/attr )
+                """,
+                "BDEPEND": """
+                    nls? ( sys-devel/gettext )
+                """,
+                "IUSE": "acl nls xattr",
+                "USE": "",
+            },
+            "sys-devel/gettext-0.22.4": {
+                "EAPI": "8",
+                "RDEPEND": """
+                    acl? ( virtual/acl )
+                    xattr? ( sys-apps/attr )
+                """,
+                "DEPEND": """
+                    acl? ( virtual/acl )
+                    xattr? ( sys-apps/attr )
+                """,
+                "IUSE": "acl nls xattr",
+                "USE": "xattr",
+            },
+            "sys-apps/attr-2.5.2-r1": {
+                "EAPI": "8",
+                "BDEPEND": "nls? ( sys-devel/gettext )",
+                "IUSE": "nls",
+                "USE": "",
+            },
+        }
+
+        binpkgs = {
+            "app-arch/tar-1.35": {
+                "EAPI": "8",
+                "RDEPEND": """
+                    acl? ( virtual/acl )
+                """,
+                "DEPEND": """
+                    acl? ( virtual/acl )
+                    xattr? ( sys-apps/attr )
+                """,
+                "BDEPEND": """
+                    nls? ( sys-devel/gettext )
+                """,
+                "IUSE": "acl nls xattr",
+                "USE": "acl nls xattr",
+            },
+            "virtual/acl-0-r2": {
+                "EAPI": "8",
+                "RDEPEND": ">=sys-apps/acl-2.2.52-r1",
+            },
+            "sys-devel/gettext-0.22.4": {
+                "EAPI": "8",
+                "RDEPEND": """
+                    acl? ( virtual/acl )
+                    xattr? ( sys-apps/attr )
+                """,
+                "DEPEND": """
+                    acl? ( virtual/acl )
+                    xattr? ( sys-apps/attr )
+                """,
+                "IUSE": "acl nls xattr",
+                "USE": "acl nls xattr",
+            },
+            "sys-apps/attr-2.5.2-r1": {
+                "EAPI": "8",
+                "BDEPEND": "nls? ( sys-devel/gettext )",
+                "IUSE": "nls",
+                "USE": "nls",
+            },
+        }
+
+        world = []
+
+        user_config = {
+            "package.use": (
+                "app-arch/tar acl nls xattr",
+                "sys-apps/acl nls",
+                "sys-apps/attr nls",
+                "sys-devel/gettext acl nls xattr",
+            ),
+        }
+
+        playground = ResolverPlayground(
+            ebuilds=ebuilds,
+            installed=installed,
+            binpkgs=binpkgs,
+            world=world,
+            user_config=user_config,
+        )
+        settings = playground.settings
+        profile_path = settings.profile_path
+
+        with open(os.path.join(profile_path, "packages"), "w") as f:
+            f.writelines(["*app-arch/tar\n"])
+        test_cases = (
+            # Check without binpkgs first
+            ResolverPlaygroundTestCase(
+                ["@world"],
+                success=True,
+                options={"--emptytree": True, "--verbose": True},
+                mergelist=[
+                    "sys-apps/acl-2.3.2-r1",
+                    "virtual/acl-0-r2",
+                    "sys-apps/attr-2.5.2-r1",
+                    "sys-devel/gettext-0.22.4",
+                    "app-arch/tar-1.35",
+                ],
+            ),
+            # In the bug, only --emptytree was broken, so check
+            # some cases without it.
+            ResolverPlaygroundTestCase(
+                ["@world"],
+                success=True,
+                options={
+                    "--usepkg": True,
+                },
+                mergelist=[
+                    "sys-apps/acl-2.3.2-r1",
+                    "[binary]virtual/acl-0-r2",
+                    "[binary]app-arch/tar-1.35",
+                ],
+            ),
+            ResolverPlaygroundTestCase(
+                ["app-arch/tar"],
+                success=True,
+                options={
+                    "--oneshot": True,
+                    "--usepkg": True,
+                },
+                mergelist=[
+                    "sys-apps/acl-2.3.2-r1",
+                    "[binary]virtual/acl-0-r2",
+                    "[binary]app-arch/tar-1.35",
+                ],
+            ),
+            # binpkg --emptytree case which broke
+            ResolverPlaygroundTestCase(
+                ["@world"],
+                success=True,
+                options={
+                    "--emptytree": True,
+                    "--usepkg": True,
+                },
+                mergelist=[
+                    "[binary]sys-apps/attr-2.5.2-r1",
+                    "[binary]virtual/acl-0-r2",
+                    "[binary]sys-devel/gettext-0.22.4",
+                    "sys-apps/acl-2.3.2-r1",
+                    "[binary]app-arch/tar-1.35",
+                ],
+            ),
+        )
+
+        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.cleanup()


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2024-02-09 21:40 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2024-02-09 21:40 UTC (permalink / raw
  To: gentoo-commits

commit:     be37f0761752f13a855aed66fa6e49e2f7211a0f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb  9 21:36:02 2024 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb  9 21:36:28 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=be37f076

EAPITestCase: Disable playground debug so tempdir is cleaned up

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/test_eapi.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/portage/tests/resolver/test_eapi.py b/lib/portage/tests/resolver/test_eapi.py
index 5d425ccdb9..32dcb49895 100644
--- a/lib/portage/tests/resolver/test_eapi.py
+++ b/lib/portage/tests/resolver/test_eapi.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2020 Gentoo Authors
+# Copyright 2010-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase
@@ -199,7 +199,7 @@ class EAPITestCase(TestCase):
             mergelist=["dev-libs/A-1.0", "dev-libs/B-1.0"],
         )
 
-        playground = ResolverPlayground(ebuilds=ebuilds, debug=True)
+        playground = ResolverPlayground(ebuilds=ebuilds)
         try:
             playground.run_TestCase(test_case)
             self.assertEqual(test_case.test_success, True, test_case.fail_msg)


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2023-12-24 19:30 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2023-12-24 19:30 UTC (permalink / raw
  To: gentoo-commits

commit:     eeb4c29a64927efbaa7028153230367651bcf3b7
Author:     Andrei Horodniceanu <a.horodniceanu <AT> proton <DOT> me>
AuthorDate: Sat Oct 21 14:38:36 2023 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec 24 19:29:16 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=eeb4c29a

tests/resolver: test depclean order with IDEPEND and circular deps

Bug: https://bugs.gentoo.org/916135
Signed-off-by: Andrei Horodniceanu <a.horodniceanu <AT> proton.me>
Closes: https://github.com/gentoo/portage/pull/1147
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/test_depclean_order.py | 50 +++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/lib/portage/tests/resolver/test_depclean_order.py b/lib/portage/tests/resolver/test_depclean_order.py
index 08dd249e11..867b1a54ca 100644
--- a/lib/portage/tests/resolver/test_depclean_order.py
+++ b/lib/portage/tests/resolver/test_depclean_order.py
@@ -1,6 +1,8 @@
 # Copyright 2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import pytest
+
 from portage.tests import TestCase
 from portage.tests.resolver.ResolverPlayground import (
     ResolverPlayground,
@@ -57,3 +59,51 @@ class SimpleDepcleanTestCase(TestCase):
                 self.assertEqual(test_case.test_success, True, test_case.fail_msg)
         finally:
             playground.cleanup()
+
+    @pytest.mark.xfail()
+    def testIDEPENDDepclean(self):
+        ebuilds = {
+            "dev-util/A-1": {},
+            "dev-libs/B-1": {
+                "EAPI": "8",
+                "IDEPEND": "dev-util/A",
+                "RDEPEND": "dev-libs/B:=",
+            },
+            "dev-libs/C-1": {},
+        }
+
+        installed = {
+            "dev-util/A-1": {},
+            "dev-libs/B-1": {
+                "EAPI": "8",
+                "IDEPEND": "dev-util/A",
+                "RDEPEND": "dev-libs/B:0/0=",
+            },
+            "dev-libs/C-1": {},
+        }
+
+        world = ("dev-libs/C",)
+
+        test_cases = (
+            # Remove dev-libs/B first because it IDEPENDs on dev-util/A
+            ResolverPlaygroundTestCase(
+                [],
+                options={"--depclean": True},
+                success=True,
+                ordered=True,
+                cleanlist=[
+                    "dev-libs/B-1",
+                    "dev-util/A-1",
+                ],
+            ),
+        )
+
+        playground = ResolverPlayground(
+            ebuilds=ebuilds, installed=installed, world=world
+        )
+        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.cleanup()


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2023-11-28 22:26 Sam James
  0 siblings, 0 replies; 56+ messages in thread
From: Sam James @ 2023-11-28 22:26 UTC (permalink / raw
  To: gentoo-commits

commit:     2b02d8f5495cd5004c294f87beb365fd490018bd
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 28 05:33:56 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Nov 28 22:07:46 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2b02d8f5

tests: add runtime cycle test case with binpkgs

In the reported bug, net-misc/curl gets merged (binary), then dev-util/cmake gets
bulit (from source) which fails because one of the built curl's dependencies
(net-libs/nghttp2) is missing:
```
[binary   R    ] net-misc/curl-8.4.0::test_repo  USE="http2%*" 0 KiB
[ebuild     U  ] dev-util/cmake-3.27.8::test_repo [3.26.5-r2::test_repo] 0 KiB
[ebuild  N     ] net-libs/nghttp2-1.57.0::test_repo  0 KiB
```

We should consider the existing dev-util/cmake as sufficient for nghttp2 and instead do:
1. net-libs/nghttp2-1.57.0
2. net-misc/curl-8.4.0 (binary)
3. dev-util/cmake-3.27.8 (upgrade, we didn't need to do this first as we already had a CMake installed)

Bug: https://bugs.gentoo.org/918683
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../resolver/test_runtime_cycle_merge_order.py     | 145 +++++++++++++++++++++
 1 file changed, 145 insertions(+)

diff --git a/lib/portage/tests/resolver/test_runtime_cycle_merge_order.py b/lib/portage/tests/resolver/test_runtime_cycle_merge_order.py
index a955ac3dc3..26850ccad2 100644
--- a/lib/portage/tests/resolver/test_runtime_cycle_merge_order.py
+++ b/lib/portage/tests/resolver/test_runtime_cycle_merge_order.py
@@ -7,6 +7,8 @@ from portage.tests.resolver.ResolverPlayground import (
     ResolverPlaygroundTestCase,
 )
 
+import pytest
+
 
 class RuntimeCycleMergeOrderTestCase(TestCase):
     def testRuntimeCycleMergeOrder(self):
@@ -74,3 +76,146 @@ class RuntimeCycleMergeOrderTestCase(TestCase):
                 self.assertEqual(test_case.test_success, True, test_case.fail_msg)
         finally:
             playground.cleanup()
+
+    @pytest.mark.xfail()
+    def testBuildtimeRuntimeCycleMergeOrder(self):
+        installed = {
+            "dev-util/cmake-3.26.5-r2": {
+                "EAPI": "8",
+                "KEYWORDS": "x86",
+                "DEPEND": "net-misc/curl",
+                "RDEPEND": "net-misc/curl",
+            },
+            "net-dns/c-ares-1.21.0": {
+                "EAPI": "8",
+                "SLOT": "0",
+                "KEYWORDS": "x86",
+                "RDEPEND": "net-dns/c-ares",
+            },
+            "net-misc/curl-8.4.0": {
+                "EAPI": "8",
+                "SLOT": "0",
+                "KEYWORDS": "x86",
+                "DEPEND": """
+                    net-dns/c-ares
+                    http2? ( net-libs/nghttp2:= )
+                """,
+                "RDEPEND": """
+                    net-dns/c-ares
+                    http2? ( net-libs/nghttp2:= )
+                 """,
+            },
+            "net-dns/c-ares-1.21.0": {
+                "EAPI": "8",
+                "SLOT": "0",
+                "KEYWORDS": "x86",
+            },
+        }
+
+        binpkgs = {
+            "net-misc/curl-8.4.0": {
+                "EAPI": "8",
+                "SLOT": "0",
+                "KEYWORDS": "x86",
+                "IUSE": "http2",
+                "USE": "http2",
+                "DEPEND": """
+                    net-dns/c-ares
+                    http2? ( net-libs/nghttp2:= )
+                """,
+                "RDEPEND": """
+                    net-dns/c-ares
+                    http2? ( net-libs/nghttp2:= )
+                """,
+            },
+            "dev-util/cmake-3.26.5-r2": {
+                "EAPI": "8",
+                "KEYWORDS": "x86",
+                "DEPEND": "net-misc/curl",
+                "RDEPEND": "net-misc/curl",
+            },
+        }
+
+        ebuilds = {
+            "dev-util/cmake-3.26.5-r2": {
+                "EAPI": "8",
+                "SLOT": "0",
+                "KEYWORDS": "x86",
+                "DEPEND": "net-misc/curl",
+                "RDEPEND": "net-misc/curl",
+            },
+            "dev-util/cmake-3.27.8": {
+                "EAPI": "8",
+                "SLOT": "0",
+                "KEYWORDS": "~x86",
+                "DEPEND": "net-misc/curl",
+                "RDEPEND": "net-misc/curl",
+            },
+            "net-dns/c-ares-1.21.0": {
+                "EAPI": "8",
+                "SLOT": "0",
+                "KEYWORDS": "x86",
+            },
+            "net-libs/nghttp2-1.57.0": {
+                "EAPI": "8",
+                "SLOT": "0",
+                "KEYWORDS": "x86",
+                "BDEPEND": "dev-util/cmake",
+                "RDEPEND": "net-dns/c-ares",
+            },
+            "net-misc/curl-8.4.0": {
+                "EAPI": "8",
+                "SLOT": "0",
+                "KEYWORDS": "x86",
+                "IUSE": "http2",
+                "DEPEND": """
+                    net-dns/c-ares
+                    http2? ( net-libs/nghttp2:= )
+                """,
+                "RDEPEND": """
+                    net-dns/c-ares
+                    http2? ( net-libs/nghttp2:= )
+                """,
+            },
+        }
+
+        world = ("dev-util/cmake",)
+
+        test_cases = (
+            ResolverPlaygroundTestCase(
+                ["@world"],
+                options={
+                    "--verbose": True,
+                    "--update": True,
+                    "--deep": True,
+                    "--newuse": True,
+                    "--usepkg": True,
+                },
+                success=True,
+                mergelist=[
+                    "net-libs/nghttp2-1.57.0",
+                    "[binary]net-misc/curl-8.4.0",
+                    "dev-util/cmake-3.27.8",
+                ],
+            ),
+        )
+
+        playground = ResolverPlayground(
+            world=world,
+            installed=installed,
+            binpkgs=binpkgs,
+            ebuilds=ebuilds,
+            debug=False,
+            user_config={
+                "make.conf": (
+                    f'ACCEPT_KEYWORDS="~x86"',
+                    f'USE="http2"',
+                ),
+            },
+        )
+        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.cleanup()


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2023-11-18  1:16 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2023-11-18  1:16 UTC (permalink / raw
  To: gentoo-commits

commit:     1525b51fb1df477f8801470509e786558ab153dc
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 17 07:47:07 2023 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Nov 17 07:57:15 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1525b51f

Add test case to reproduce bug 917259

Test bug 917259, where app-alternatives/gzip is upgraded
before its pigz RDEPEND is installed. This is triggered
when find_smallest_cycle selects a large cycle and the
topological sort produces poor results when leaf_nodes returns
app-alternatives/gzip as part of a large group of nodes.
This problem might be solved by implementing a finer-grained
ignore_priority for leaf_nodes calls.

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

 lib/portage/tests/resolver/meson.build             |   1 +
 .../tests/resolver/test_alternatives_gzip.py       | 248 +++++++++++++++++++++
 2 files changed, 249 insertions(+)

diff --git a/lib/portage/tests/resolver/meson.build b/lib/portage/tests/resolver/meson.build
index 0d8c2921e1..7d2bd367d4 100644
--- a/lib/portage/tests/resolver/meson.build
+++ b/lib/portage/tests/resolver/meson.build
@@ -1,6 +1,7 @@
 py.install_sources(
     [
         'ResolverPlayground.py',
+        'test_alternatives_gzip.py',
         'test_aggressive_backtrack_downgrade.py',
         'test_autounmask.py',
         'test_autounmask_binpkg_use.py',

diff --git a/lib/portage/tests/resolver/test_alternatives_gzip.py b/lib/portage/tests/resolver/test_alternatives_gzip.py
new file mode 100644
index 0000000000..602ed1756f
--- /dev/null
+++ b/lib/portage/tests/resolver/test_alternatives_gzip.py
@@ -0,0 +1,248 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+import pytest
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (
+    ResolverPlayground,
+    ResolverPlaygroundTestCase,
+)
+
+
+@pytest.mark.xfail()
+class AlternativesGzipTestCase(TestCase):
+    def testAlternativesGzip(self):
+        """
+        Test bug 917259, where app-alternatives/gzip is upgraded before
+        its pigz RDEPEND is installed. This is triggered when
+        find_smallest_cycle selects a large cycle and the topological
+        sort produces poor results when leaf_nodes returns
+        app-alternatives/gzip as part of a large group of nodes.
+        This problem might be solved by implementing a finer-grained
+        ignore_priority for leaf_nodes calls.
+        """
+        ebuilds = {
+            "app-alternatives/gzip-1": {
+                "EAPI": "8",
+                "RDEPEND": "reference? ( >=app-arch/gzip-1.12-r3 ) pigz? ( >=app-arch/pigz-2.8[-symlink(-)] )",
+                "IUSE": "reference pigz",
+                "REQUIRED_USE": "^^ ( reference pigz )",
+            },
+            "app-alternatives/gzip-0": {
+                "EAPI": "8",
+                "RDEPEND": "reference? ( >=app-arch/gzip-1.12-r3 ) pigz? ( app-arch/pigz[-symlink(-)] )",
+                "IUSE": "reference pigz",
+                "REQUIRED_USE": "^^ ( reference pigz )",
+            },
+            "app-arch/gzip-1.13": {
+                "EAPI": "8",
+                "RDEPEND": "!app-arch/pigz[symlink(-)]",
+                "PDEPEND": "app-alternatives/gzip",
+            },
+            "app-arch/zstd-1.5.5": {
+                "EAPI": "8",
+                "DEPEND": ">=sys-libs/zlib-1.2.3",
+                "RDEPEND": ">=sys-libs/zlib-1.2.3",
+            },
+            "app-arch/pigz-2.8": {
+                "EAPI": "8",
+                "DEPEND": ">=sys-libs/zlib-1.2.3",
+                "RDEPEND": ">=sys-libs/zlib-1.2.3",
+                "PDEPEND": "app-alternatives/gzip",
+            },
+            "dev-lang/perl-5.36.1-r3": {
+                "EAPI": "8",
+                "BDEPEND": ">=sys-libs/zlib-1.2.12 virtual/libcrypt:=",
+                "RDEPEND": ">=sys-libs/zlib-1.2.12 virtual/libcrypt:=",
+                "DEPEND": ">=sys-libs/zlib-1.2.12 virtual/libcrypt:=",
+            },
+            "dev-libs/libgcrypt-1.10.2": {
+                "EAPI": "8",
+                "SLOT": "0",
+                "BDEPEND": ">=sys-devel/automake-1.16.5",
+                "DEPEND": "sys-libs/glibc",
+                "RDEPEND": "sys-libs/glibc",
+            },
+            "dev-libs/libpcre2-10.42-r1": {
+                "EAPI": "8",
+                "SLOT": "0/3",
+                "DEPEND": "sys-libs/zlib",
+                "RDEPEND": "sys-libs/zlib",
+            },
+            "sys-apps/locale-gen-2.23-r1": {
+                "EAPI": "8",
+                "RDEPEND": "app-alternatives/gzip",
+            },
+            "sys-apps/systemd-253.6": {
+                "EAPI": "8",
+                "SLOT": "0/2",
+                "BDEPEND": "dev-lang/perl",
+                "DEPEND": ">=sys-apps/util-linux-2.30:= >=dev-libs/libgcrypt-1.4.5:0= virtual/libcrypt:= dev-libs/libpcre2",
+                "RDEPEND": ">=sys-apps/util-linux-2.30:= >=dev-libs/libgcrypt-1.4.5:0= virtual/libcrypt:= dev-libs/libpcre2",
+            },
+            "sys-apps/util-linux-2.38.1-r2": {
+                "EAPI": "8",
+                "BDEPEND": ">=sys-devel/automake-1.16.5",
+                "DEPEND": "virtual/libcrypt:= sys-libs/zlib:= virtual/libudev:= dev-libs/libpcre2:=",
+                "RDEPEND": "sys-apps/systemd sys-libs/zlib:= virtual/libudev:= dev-libs/libpcre2:=",
+            },
+            "sys-devel/automake-1.16.5-r1": {
+                "EAPI": "8",
+                "BDEPEND": "app-alternatives/gzip",
+                "RDEPEND": ">=dev-lang/perl-5.6",
+            },
+            "sys-libs/glibc-2.37-r7": {
+                "EAPI": "8",
+                "BDEPEND": "sys-apps/locale-gen",
+                "IDEPEND": "sys-apps/locale-gen",
+                "RDEPEND": "dev-lang/perl",
+            },
+            "sys-libs/libxcrypt-4.4.36": {
+                "BDEPEND": "dev-lang/perl",
+                "DEPEND": "sys-libs/glibc",
+                "RDEPEND": "sys-libs/glibc",
+            },
+            "sys-libs/zlib-1.3-r1": {
+                "EAPI": "8",
+                "SLOT": "0/1",
+                "BDEPEND": ">=sys-devel/automake-1.16.5",
+            },
+            "sys-libs/zlib-1.2.13-r2": {
+                "EAPI": "8",
+                "SLOT": "0/1",
+                "BDEPEND": ">=sys-devel/automake-1.16.5",
+            },
+            "virtual/libcrypt-2-r1": {
+                "EAPI": "8",
+                "SLOT": "0/2",
+                "RDEPEND": "sys-libs/libxcrypt",
+            },
+            "virtual/libudev-251-r2": {
+                "EAPI": "8",
+                "SLOT": "0/1",
+                "RDEPEND": ">=sys-apps/systemd-251:0/2",
+            },
+        }
+
+        installed = {
+            "app-alternatives/gzip-0": {
+                "EAPI": "8",
+                "RDEPEND": "reference? ( >=app-arch/gzip-1.12-r3 ) pigz? ( app-arch/pigz[-symlink(-)] )",
+                "IUSE": "reference pigz",
+                "USE": "reference",
+            },
+            "app-arch/gzip-1.13": {
+                "EAPI": "8",
+                "RDEPEND": "!app-arch/pigz[symlink(-)]",
+                "PDEPEND": "app-alternatives/gzip",
+            },
+            "app-arch/zstd-1.5.5": {
+                "EAPI": "8",
+                "DEPEND": ">=sys-libs/zlib-1.2.3",
+                "RDEPEND": ">=sys-libs/zlib-1.2.3",
+            },
+            "dev-lang/perl-5.36.1-r3": {
+                "EAPI": "8",
+                "BDEPEND": ">=sys-libs/zlib-1.2.12 virtual/libcrypt:0/2=",
+                "RDEPEND": ">=sys-libs/zlib-1.2.12 virtual/libcrypt:0/2=",
+                "DEPEND": ">=sys-libs/zlib-1.2.12 virtual/libcrypt:0/2=",
+            },
+            "dev-libs/libgcrypt-1.10.2": {
+                "EAPI": "8",
+                "SLOT": "0",
+                "BDEPEND": ">=sys-devel/automake-1.16.5",
+                "DEPEND": "sys-libs/glibc",
+                "RDEPEND": "sys-libs/glibc",
+            },
+            "dev-libs/libpcre2-10.42-r1": {
+                "EAPI": "8",
+                "SLOT": "0/3",
+                "DEPEND": "sys-libs/zlib",
+                "RDEPEND": "sys-libs/zlib",
+            },
+            "sys-apps/locale-gen-2.23-r1": {
+                "EAPI": "8",
+                "RDEPEND": "app-alternatives/gzip",
+            },
+            "sys-apps/systemd-253.6": {
+                "EAPI": "8",
+                "SLOT": "0/2",
+                "BDEPEND": "dev-lang/perl",
+                "DEPEND": ">=sys-apps/util-linux-2.30:0= >=dev-libs/libgcrypt-1.4.5:0= virtual/libcrypt:0/2= dev-libs/libpcre2",
+                "RDEPEND": ">=sys-apps/util-linux-2.30:0= >=dev-libs/libgcrypt-1.4.5:0= virtual/libcrypt:0/2= dev-libs/libpcre2",
+            },
+            "sys-apps/util-linux-2.38.1-r2": {
+                "EAPI": "8",
+                "BDEPEND": ">=sys-devel/automake-1.16.5",
+                "DEPEND": "virtual/libcrypt:0/2= sys-libs/zlib:0/1= virtual/libudev:0/1= dev-libs/libpcre2:0/3=",
+                "RDEPEND": "sys-apps/systemd sys-libs/zlib:0/1= virtual/libudev:0/1= dev-libs/libpcre2:0/3=",
+            },
+            "sys-devel/automake-1.16.5-r1": {
+                "EAPI": "8",
+                "BDEPEND": "app-alternatives/gzip",
+                "RDEPEND": ">=dev-lang/perl-5.6",
+            },
+            "sys-libs/glibc-2.37-r7": {
+                "EAPI": "8",
+                "BDEPEND": "sys-apps/locale-gen",
+                "IDEPEND": "sys-apps/locale-gen",
+                "RDEPEND": "dev-lang/perl",
+            },
+            "sys-libs/libxcrypt-4.4.36": {
+                "BDEPEND": "dev-lang/perl",
+                "DEPEND": "sys-libs/glibc",
+                "RDEPEND": "sys-libs/glibc",
+            },
+            "sys-libs/zlib-1.2.13-r2": {
+                "EAPI": "8",
+                "SLOT": "0/1",
+                "BDEPEND": ">=sys-devel/automake-1.16.5",
+            },
+            "virtual/libcrypt-2-r1": {
+                "EAPI": "8",
+                "SLOT": "0/2",
+                "RDEPEND": "sys-libs/libxcrypt",
+            },
+            "virtual/libudev-251-r2": {
+                "EAPI": "8",
+                "SLOT": "0/1",
+                "RDEPEND": ">=sys-apps/systemd-251:0/2",
+            },
+        }
+
+        world = [
+            "app-alternatives/gzip",
+            "app-arch/gzip",
+            "app-arch/zstd",
+            "sys-apps/systemd",
+        ]
+
+        user_config = {
+            "package.use": ("app-alternatives/gzip -reference pigz",),
+        }
+
+        test_cases = (
+            ResolverPlaygroundTestCase(
+                ["app-alternatives/gzip", "sys-libs/zlib"],
+                success=True,
+                mergelist=[
+                    "sys-libs/zlib-1.3-r1",
+                    "app-arch/pigz-2.8",
+                    "app-alternatives/gzip-1",
+                ],
+            ),
+        )
+
+        playground = ResolverPlayground(
+            ebuilds=ebuilds,
+            installed=installed,
+            world=world,
+            user_config=user_config,
+        )
+        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.cleanup()


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2023-06-19 21:17 Sam James
  0 siblings, 0 replies; 56+ messages in thread
From: Sam James @ 2023-06-19 21:17 UTC (permalink / raw
  To: gentoo-commits

commit:     ed1314f10623b25365a697c74eb25d557eb91edd
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 19 20:25:34 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun 19 21:17:37 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ed1314f1

tests: rename test_unecessary_slot_upgrade.py -> test_unnecessary_slot_upgrade.py

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../{test_unecessary_slot_upgrade.py => test_unnecessary_slot_upgrade.py} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/lib/portage/tests/resolver/test_unecessary_slot_upgrade.py b/lib/portage/tests/resolver/test_unnecessary_slot_upgrade.py
similarity index 100%
rename from lib/portage/tests/resolver/test_unecessary_slot_upgrade.py
rename to lib/portage/tests/resolver/test_unnecessary_slot_upgrade.py


^ permalink raw reply	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2023-06-16  3:34 Sam James
  0 siblings, 0 replies; 56+ messages in thread
From: Sam James @ 2023-06-16  3:34 UTC (permalink / raw
  To: gentoo-commits

commit:     ff457f742b513a65e6609054e5310f8beee488ec
Author:     YiFei Zhu <zhuyifei1999 <AT> gmail <DOT> com>
AuthorDate: Tue Jun 13 08:08:51 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jun 16 03:34:46 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ff457f74

tests: resolver: Test the broken behavior of Perl rebuild bug

Bug: https://bugs.gentoo.org/463976
Bug: https://bugs.gentoo.org/592880
Bug: https://bugs.gentoo.org/596664
Bug: https://bugs.gentoo.org/631490
Bug: https://bugs.gentoo.org/764365
Bug: https://bugs.gentoo.org/793992
Signed-off-by: YiFei Zhu <zhuyifei1999 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../tests/resolver/test_perl_rebuild_bug.py        | 121 +++++++++++++++++++++
 1 file changed, 121 insertions(+)

diff --git a/lib/portage/tests/resolver/test_perl_rebuild_bug.py b/lib/portage/tests/resolver/test_perl_rebuild_bug.py
new file mode 100644
index 000000000..928fd47d7
--- /dev/null
+++ b/lib/portage/tests/resolver/test_perl_rebuild_bug.py
@@ -0,0 +1,121 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (
+    ResolverPlayground,
+    ResolverPlaygroundTestCase,
+)
+
+
+class PerlRebuildBugTestCase(TestCase):
+    def __init__(self, *args, **kwargs):
+        super().__init__(*args, **kwargs)
+
+    def testPerlRebuildBug(self):
+        """
+        The infamous Perl rebuild bug.
+
+        A non-slotted build-time dependency cycle is created by:
+        dev-lang/perl -> sys-libs/zlib -> sys-devel/automake -> dev-lang/perl
+        Everything else depends on this cycle.
+
+        Bug in solving for smallest cycle causes slot in RDEPEND of
+        dev-perl/Locale-gettext to be ignored, so all dependencies other than
+        perl's >=sys-libs/zlib-1.2.12 are satisfied by already-installed
+        packages. dev-perl/Locale-gettext and sys-devel/automake become leaves
+        of the depgraph after satisfied packages are ignored. They become
+        emerged first. This causes an issue because dev-perl/Locale-gettext is
+        now built before the slot upgrade of dev-lang/perl.
+        """
+        ebuilds = {
+            "dev-lang/perl-5.36.0-r2": {
+                "EAPI": "5",
+                "DEPEND": ">=sys-libs/zlib-1.2.12",
+                "RDEPEND": ">=sys-libs/zlib-1.2.12",
+                "SLOT": "0/5.36",
+            },
+            "dev-perl/Locale-gettext-1.70.0-r1": {
+                "EAPI": "5",
+                "DEPEND": "dev-lang/perl",
+                "RDEPEND": "dev-lang/perl:=",
+            },
+            "sys-apps/help2man-1.49.3": {
+                "EAPI": "5",
+                "DEPEND": "dev-lang/perl dev-perl/Locale-gettext",
+                "RDEPEND": "dev-lang/perl dev-perl/Locale-gettext",
+            },
+            "sys-devel/automake-1.16.5": {
+                "EAPI": "5",
+                "DEPEND": "dev-lang/perl",
+                "RDEPEND": "dev-lang/perl",
+            },
+            "sys-libs/zlib-1.2.13-r1": {
+                "EAPI": "5",
+                "DEPEND": "sys-devel/automake",
+            },
+        }
+
+        installed = {
+            "dev-lang/perl-5.34.0-r3": {
+                "EAPI": "5",
+                "DEPEND": "sys-libs/zlib",
+                "RDEPEND": "sys-libs/zlib",
+                "SLOT": "0/5.34",
+            },
+            "dev-perl/Locale-gettext-1.70.0-r1": {
+                "EAPI": "5",
+                "DEPEND": "dev-lang/perl",
+                "RDEPEND": "dev-lang/perl:0/5.34=",
+            },
+            "sys-apps/help2man-1.48.5": {
+                "EAPI": "5",
+                "DEPEND": "dev-lang/perl dev-perl/Locale-gettext",
+                "RDEPEND": "dev-lang/perl dev-perl/Locale-gettext",
+            },
+            "sys-devel/automake-1.16.4": {
+                "EAPI": "5",
+                "DEPEND": "dev-lang/perl",
+                "RDEPEND": "dev-lang/perl",
+            },
+            "sys-libs/zlib-1.2.11-r4": {
+                "EAPI": "5",
+                "DEPEND": "sys-devel/automake",
+            },
+        }
+
+        world = ["sys-apps/help2man"]
+
+        test_cases = (
+            ResolverPlaygroundTestCase(
+                ["@world"],
+                options={"--deep": True, "--update": True, "--verbose": True},
+                success=True,
+                ambiguous_merge_order=True,
+                merge_order_assertions=(
+                    (
+                        "dev-perl/Locale-gettext-1.70.0-r1",
+                        "dev-lang/perl-5.36.0-r2",
+                    ),
+                ),
+                mergelist=[
+                    "dev-perl/Locale-gettext-1.70.0-r1",
+                    "sys-devel/automake-1.16.5",
+                    "sys-libs/zlib-1.2.13-r1",
+                    "dev-lang/perl-5.36.0-r2",
+                    "sys-apps/help2man-1.49.3",
+                ],
+            ),
+        )
+
+        playground = ResolverPlayground(
+            ebuilds=ebuilds,
+            installed=installed,
+            world=world,
+        )
+        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.cleanup()


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2023-06-16  3:34 Sam James
  0 siblings, 0 replies; 56+ messages in thread
From: Sam James @ 2023-06-16  3:34 UTC (permalink / raw
  To: gentoo-commits

commit:     2af4bc17d1b4ea1581bb191dfa7f34ec64ab140b
Author:     YiFei Zhu <zhuyifei1999 <AT> gmail <DOT> com>
AuthorDate: Mon Jun 12 02:07:39 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jun 16 03:34:46 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2af4bc17

tests: resolver: Test the (bad) behavior of bug #622270

Without fixing the bug. This is so we have a baseline behavior to
compare against.

Bug: https://bugs.gentoo.org/439688
Bug: https://bugs.gentoo.org/622270
Signed-off-by: YiFei Zhu <zhuyifei1999 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../resolver/test_slot_conflict_blocked_prune.py   | 78 ++++++++++++++++++++++
 1 file changed, 78 insertions(+)

diff --git a/lib/portage/tests/resolver/test_slot_conflict_blocked_prune.py b/lib/portage/tests/resolver/test_slot_conflict_blocked_prune.py
new file mode 100644
index 000000000..14e98cd00
--- /dev/null
+++ b/lib/portage/tests/resolver/test_slot_conflict_blocked_prune.py
@@ -0,0 +1,78 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (
+    ResolverPlayground,
+    ResolverPlaygroundTestCase,
+)
+
+
+class SlotConflictBlockedPruneTestCase(TestCase):
+    def testSlotConflictBlockedPrune(self):
+        """
+        Bug 622270
+        Downgrading package (as openssl here) due to un-accepting unstable.
+        Dependent package (as rustup here) cannot be rebuilt due to missing
+        keyword, so dependee downgrade is cancelled, but other dependents
+        (such as xwayland here) are rebuilt nevertheless. This should not
+        happen and the rebuilds should be pruned.
+        """
+        ebuilds = {
+            "x11-base/xwayland-23.1.1": {
+                "EAPI": "5",
+                "RDEPEND": "dev-libs/openssl:=",
+            },
+            "dev-util/rustup-1.25.2": {
+                "EAPI": "5",
+                "RDEPEND": "dev-libs/openssl:0=",
+                "KEYWORDS": "~x86",
+            },
+            "dev-libs/openssl-1.1.1u": {
+                "EAPI": "5",
+                "SLOT": "0/1.1",
+            },
+            "dev-libs/openssl-3.1.1": {
+                "EAPI": "5",
+                "SLOT": "0/3",
+                "KEYWORDS": "~x86",
+            },
+        }
+
+        installed = {
+            "x11-base/xwayland-23.1.1": {
+                "EAPI": "5",
+                "RDEPEND": "dev-libs/openssl:0/3=",
+            },
+            "dev-util/rustup-1.25.2": {
+                "EAPI": "5",
+                "RDEPEND": "dev-libs/openssl:0/3=",
+                "KEYWORDS": "~x86",
+            },
+            "dev-libs/openssl-3.1.1": {
+                "EAPI": "5",
+                "SLOT": "0/3",
+                "KEYWORDS": "~x86",
+            },
+        }
+
+        world = ["x11-base/xwayland", "dev-util/rustup"]
+
+        test_cases = (
+            ResolverPlaygroundTestCase(
+                ["@world"],
+                options={"--deep": True, "--update": True, "--verbose": True},
+                success=True,
+                mergelist=["x11-base/xwayland-23.1.1"],
+            ),
+        )
+
+        playground = ResolverPlayground(
+            ebuilds=ebuilds, installed=installed, world=world
+        )
+        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.cleanup()


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2023-05-26 15:45 Sam James
  0 siblings, 0 replies; 56+ messages in thread
From: Sam James @ 2023-05-26 15:45 UTC (permalink / raw
  To: gentoo-commits

commit:     8469e5fa81f34466a15d3a422b0bb04a19f19869
Author:     David Palao <david.palao <AT> gmail <DOT> com>
AuthorDate: Fri May  5 13:17:20 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 26 15:44:36 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=8469e5fa

tests: resolver: port testAutounmaskUseSlotConflict to pytest using xfail

Signed-off-by: David Palao <david.palao <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/portage/tests/resolver/test_autounmask_use_slot_conflict.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/portage/tests/resolver/test_autounmask_use_slot_conflict.py b/lib/portage/tests/resolver/test_autounmask_use_slot_conflict.py
index 5f3e03b56..2db1396bc 100644
--- a/lib/portage/tests/resolver/test_autounmask_use_slot_conflict.py
+++ b/lib/portage/tests/resolver/test_autounmask_use_slot_conflict.py
@@ -1,6 +1,8 @@
-# Copyright 2017-2021 Gentoo Authors
+# Copyright 2017-2021, 2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+import pytest
+
 from portage.tests import TestCase
 from portage.tests.resolver.ResolverPlayground import (
     ResolverPlayground,
@@ -9,6 +11,7 @@ from portage.tests.resolver.ResolverPlayground import (
 
 
 class AutounmaskUseSlotConflictTestCase(TestCase):
+    @pytest.mark.xfail()
     def testAutounmaskUseSlotConflict(self):
         self.todo = True
 


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2023-05-26 15:45 Sam James
  0 siblings, 0 replies; 56+ messages in thread
From: Sam James @ 2023-05-26 15:45 UTC (permalink / raw
  To: gentoo-commits

commit:     811fcbc046bb4657af311c98936abdf0e26c58a2
Author:     David Palao <david.palao <AT> gmail <DOT> com>
AuthorDate: Fri Apr 28 14:19:37 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 26 15:44:36 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=811fcbc0

tests: resolver: use xfail w/ pytest

Signed-off-by: David Palao <david.palao <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/portage/tests/resolver/test_or_choices.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/portage/tests/resolver/test_or_choices.py b/lib/portage/tests/resolver/test_or_choices.py
index 9e2c0980b..19ecfe31c 100644
--- a/lib/portage/tests/resolver/test_or_choices.py
+++ b/lib/portage/tests/resolver/test_or_choices.py
@@ -3,6 +3,8 @@
 
 import itertools
 
+import pytest
+
 from portage.tests import TestCase
 from portage.tests.resolver.ResolverPlayground import (
     ResolverPlayground,
@@ -637,6 +639,7 @@ class OrChoicesTestCase(TestCase):
 
 
 class OrChoicesLibpostprocTestCase(TestCase):
+    @pytest.mark.xfail(reason="Irrelevant blocker conflict")
     def testOrChoicesLibpostproc(self):
         # This test case is expected to fail after the fix for bug 706278,
         # since the "undesirable" slot upgrade which triggers a blocker conflict


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2023-05-26 15:45 Sam James
  0 siblings, 0 replies; 56+ messages in thread
From: Sam James @ 2023-05-26 15:45 UTC (permalink / raw
  To: gentoo-commits

commit:     43f6dc219035bacd1bb3013c457fd3ea64f2d0d8
Author:     David Palao <david.palao <AT> gmail <DOT> com>
AuthorDate: Mon May  1 09:26:54 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 26 15:44:36 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=43f6dc21

tests: resolver: port testAutounmaskMultilibUse to pytest using xfail

...instead of the addTodo mechanism.

Signed-off-by: David Palao <david.palao <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/portage/tests/resolver/test_autounmask_multilib_use.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/portage/tests/resolver/test_autounmask_multilib_use.py b/lib/portage/tests/resolver/test_autounmask_multilib_use.py
index b25318343..9be0f09cf 100644
--- a/lib/portage/tests/resolver/test_autounmask_multilib_use.py
+++ b/lib/portage/tests/resolver/test_autounmask_multilib_use.py
@@ -1,6 +1,8 @@
 # Copyright 2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import pytest
+
 from portage.tests import TestCase
 from portage.tests.resolver.ResolverPlayground import (
     ResolverPlayground,
@@ -9,6 +11,7 @@ from portage.tests.resolver.ResolverPlayground import (
 
 
 class AutounmaskMultilibUseTestCase(TestCase):
+    @pytest.mark.xfail()
     def testAutounmaskMultilibUse(self):
         self.todo = True
 


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2023-02-19 19:19 Sam James
  0 siblings, 0 replies; 56+ messages in thread
From: Sam James @ 2023-02-19 19:19 UTC (permalink / raw
  To: gentoo-commits

commit:     996babb5aa005edef4abb86de1dc585d630ac21d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 18 13:26:47 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Feb 19 19:19:44 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=996babb5

tests: resolver: add basic BDEPEND + IDEPEND tests

These aren't very interesting but they at least check that
BDEPEND/IDEPEND affect dependency resolution.

I started to look at testing --with-bdeps but got into
the weeds.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/portage/tests/resolver/test_eapi.py | 43 +++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/lib/portage/tests/resolver/test_eapi.py b/lib/portage/tests/resolver/test_eapi.py
index 1d6c58633..5d425ccdb 100644
--- a/lib/portage/tests/resolver/test_eapi.py
+++ b/lib/portage/tests/resolver/test_eapi.py
@@ -185,3 +185,46 @@ class EAPITestCase(TestCase):
                 self.assertEqual(test_case.test_success, True, test_case.fail_msg)
         finally:
             playground.cleanup()
+
+    def testBdepend(self):
+        ebuilds = {
+            "dev-libs/A-1.0": {"EAPI": 7},
+            "dev-libs/B-1.0": {"EAPI": 7, "BDEPEND": "dev-libs/A"},
+        }
+
+        # Verify that BDEPEND is considered at all.
+        test_case = ResolverPlaygroundTestCase(
+            ["=dev-libs/B-1.0"],
+            success=True,
+            mergelist=["dev-libs/A-1.0", "dev-libs/B-1.0"],
+        )
+
+        playground = ResolverPlayground(ebuilds=ebuilds, debug=True)
+        try:
+            playground.run_TestCase(test_case)
+            self.assertEqual(test_case.test_success, True, test_case.fail_msg)
+        finally:
+            playground.cleanup()
+
+    def testIdepend(self):
+        ebuilds = {
+            "dev-libs/A-1.0": {"EAPI": 8},
+            "dev-libs/B-1.0": {"EAPI": 8, "IDEPEND": "dev-libs/A"},
+        }
+
+        test_cases = (
+            # Verify that IDEPEND is considered at all.
+            ResolverPlaygroundTestCase(
+                ["=dev-libs/B-1.0"],
+                success=True,
+                mergelist=["dev-libs/A-1.0", "dev-libs/B-1.0"],
+            ),
+        )
+
+        playground = ResolverPlayground(ebuilds=ebuilds)
+        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.cleanup()


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2023-01-02 20:45 Mike Gilbert
  0 siblings, 0 replies; 56+ messages in thread
From: Mike Gilbert @ 2023-01-02 20:45 UTC (permalink / raw
  To: gentoo-commits

commit:     d1eedbb56386e2e7509c6140a238280aaf55eb17
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 31 22:52:25 2022 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Jan  2 20:35:29 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d1eedbb5

ResolverPlayground: include PATH in env passed to portage.create_trees()

Fixes failing tests after previous change to _doebuild_path.

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 lib/portage/tests/resolver/ResolverPlayground.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/portage/tests/resolver/ResolverPlayground.py b/lib/portage/tests/resolver/ResolverPlayground.py
index e43b12dd3..6cd10acda 100644
--- a/lib/portage/tests/resolver/ResolverPlayground.py
+++ b/lib/portage/tests/resolver/ResolverPlayground.py
@@ -686,6 +686,7 @@ class ResolverPlayground:
             create_trees_kwargs["target_root"] = self.target_root
 
         env = {
+            "PATH": os.environ["PATH"],
             "PORTAGE_REPOSITORIES": "\n".join(
                 "[%s]\n%s"
                 % (
@@ -693,7 +694,7 @@ class ResolverPlayground:
                     "\n".join("{} = {}".format(k, v) for k, v in repo_config.items()),
                 )
                 for repo_name, repo_config in self._repositories.items()
-            )
+            ),
         }
 
         if self.debug:


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2022-07-25 22:01 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2022-07-25 22:01 UTC (permalink / raw
  To: gentoo-commits

commit:     44ea72efd7378cb26cb58cea7534449b1f4968c6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 25 21:36:16 2022 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jul 25 21:37:04 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=44ea72ef

ResolverPlayground: unconditionally setup essential_binaries

Closes: https://bugs.gentoo.org/861077
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/ResolverPlayground.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/portage/tests/resolver/ResolverPlayground.py b/lib/portage/tests/resolver/ResolverPlayground.py
index 788334f89..361de16af 100644
--- a/lib/portage/tests/resolver/ResolverPlayground.py
+++ b/lib/portage/tests/resolver/ResolverPlayground.py
@@ -129,8 +129,11 @@ class ResolverPlayground:
         """
 
         self.debug = debug
-        if eprefix is None:
-            self.eprefix = normalize_path(tempfile.mkdtemp())
+        if True:
+            if eprefix is None:
+                self.eprefix = normalize_path(tempfile.mkdtemp())
+            else:
+                self.eprefix = normalize_path(eprefix)
 
             # EPREFIX/bin is used by fake true_binaries. Real binaries goes into EPREFIX/usr/bin
             eubin = os.path.join(self.eprefix, "usr", "bin")
@@ -192,8 +195,6 @@ class ResolverPlayground:
                     os.symlink(path, os.path.join(eubin, x))
             finally:
                 os.environ["PATH"] = orig_path
-        else:
-            self.eprefix = normalize_path(eprefix)
 
         # Tests may override portage.const.EPREFIX in order to
         # simulate a prefix installation. It's reasonable to do


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2022-07-25 20:44 Mike Gilbert
  0 siblings, 0 replies; 56+ messages in thread
From: Mike Gilbert @ 2022-07-25 20:44 UTC (permalink / raw
  To: gentoo-commits

commit:     377af689e165db987981385a1f683444c9cdfcda
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 25 20:19:26 2022 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Jul 25 20:19:26 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=377af689

ResolverPlayground: add "bash" to essential_binaries

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 lib/portage/tests/resolver/ResolverPlayground.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/portage/tests/resolver/ResolverPlayground.py b/lib/portage/tests/resolver/ResolverPlayground.py
index ec69ee068..788334f89 100644
--- a/lib/portage/tests/resolver/ResolverPlayground.py
+++ b/lib/portage/tests/resolver/ResolverPlayground.py
@@ -146,6 +146,7 @@ class ResolverPlayground:
             essential_binaries = (
                 "awk",
                 "basename",
+                "bash",
                 "bzip2",
                 "cat",
                 "chgrp",


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2022-02-14  0:14 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2022-02-14  0:14 UTC (permalink / raw
  To: gentoo-commits

commit:     041763a8b7cda7dac0b75aa4a85eb73f333b7e55
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 14 00:11:43 2022 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 14 00:13:05 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=041763a8

Add unit test to reproduce bug 833014

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

 lib/portage/tests/resolver/test_installkernel.py | 111 +++++++++++++++++++++++
 1 file changed, 111 insertions(+)

diff --git a/lib/portage/tests/resolver/test_installkernel.py b/lib/portage/tests/resolver/test_installkernel.py
new file mode 100644
index 000000000..b73bbe5bb
--- /dev/null
+++ b/lib/portage/tests/resolver/test_installkernel.py
@@ -0,0 +1,111 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (
+    ResolverPlayground,
+    ResolverPlaygroundTestCase,
+)
+
+
+class InstallKernelTestCase(TestCase):
+    def testInstallKernel(self):
+        ebuilds = {
+            "sys-kernel/installkernel-systemd-boot-1": {
+                "EAPI": "8",
+                "RDEPEND": "!sys-kernel/installkernel-gentoo",
+            },
+            "sys-kernel/installkernel-gentoo-3": {
+                "EAPI": "8",
+                "RDEPEND": "!sys-kernel/installkernel-systemd-boot",
+            },
+            "sys-kernel/gentoo-kernel-5.15.23": {
+                "EAPI": "8",
+                "PDEPEND": ">=virtual/dist-kernel-5.15.23",
+                "RDEPEND": "|| ( sys-kernel/installkernel-gentoo sys-kernel/installkernel-systemd-boot )",
+            },
+            "sys-kernel/gentoo-kernel-bin-5.15.23": {
+                "EAPI": "8",
+                "PDEPEND": ">=virtual/dist-kernel-5.15.23",
+                "RDEPEND": "|| ( sys-kernel/installkernel-gentoo sys-kernel/installkernel-systemd-boot )",
+            },
+            "virtual/dist-kernel-5.15.23": {
+                "EAPI": "8",
+                "PDEPEND": "|| ( ~sys-kernel/gentoo-kernel-5.15.23 ~sys-kernel/gentoo-kernel-bin-5.15.23 )",
+            },
+        }
+
+        installed = {
+            "sys-kernel/installkernel-gentoo-3": {
+                "EAPI": "8",
+                "RDEPEND": "!sys-kernel/installkernel-systemd-boot",
+            },
+        }
+
+        test_cases = (
+            ResolverPlaygroundTestCase(
+                [
+                    "sys-kernel/installkernel-systemd-boot",
+                ],
+                ambiguous_merge_order=True,
+                success=True,
+                mergelist=[
+                    "sys-kernel/installkernel-systemd-boot-1",
+                    "[uninstall]sys-kernel/installkernel-gentoo-3",
+                    (
+                        "!sys-kernel/installkernel-gentoo",
+                        "!sys-kernel/installkernel-systemd-boot",
+                    ),
+                ],
+            ),
+            # Demonstrate bug 833014, where the calculation fails unless
+            # --update and --deep are specified.
+            ResolverPlaygroundTestCase(
+                [
+                    "sys-kernel/installkernel-systemd-boot",
+                    "sys-kernel/gentoo-kernel-bin",
+                ],
+                ambiguous_merge_order=True,
+                success=False,
+                mergelist=[
+                    "sys-kernel/installkernel-systemd-boot-1",
+                    "sys-kernel/gentoo-kernel-bin-5.15.23",
+                    "virtual/dist-kernel-5.15.23",
+                    (
+                        "!sys-kernel/installkernel-gentoo",
+                        "!sys-kernel/installkernel-systemd-boot",
+                    ),
+                ],
+            ),
+            ResolverPlaygroundTestCase(
+                [
+                    "sys-kernel/installkernel-systemd-boot",
+                    "sys-kernel/gentoo-kernel-bin",
+                ],
+                ambiguous_merge_order=True,
+                success=True,
+                options={"--deep": True, "--update": True},
+                mergelist=[
+                    "virtual/dist-kernel-5.15.23",
+                    "sys-kernel/installkernel-systemd-boot-1",
+                    "sys-kernel/gentoo-kernel-bin-5.15.23",
+                    "[uninstall]sys-kernel/installkernel-gentoo-3",
+                    (
+                        "!sys-kernel/installkernel-systemd-boot",
+                        "!sys-kernel/installkernel-gentoo",
+                    ),
+                ],
+            ),
+        )
+
+        playground = ResolverPlayground(
+            debug=False, ebuilds=ebuilds, installed=installed
+        )
+
+        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()


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2021-05-24  6:33 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2021-05-24  6:33 UTC (permalink / raw
  To: gentoo-commits

commit:     8d442378bbb03b1c95595d0a21a012291245bda7
Author:     Felix Bier <flx.bier <AT> gmail <DOT> com>
AuthorDate: Tue May 11 21:46:49 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 24 06:22:38 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=8d442378

unmerge: Add tests for unmerge order

This commit adds unit tests for verifying the unmerge order
that is calculated by unmerge_display().

Signed-off-by: Felix Bier <felix.bier <AT> rohde-schwarz.com>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/test_unmerge_order.py | 179 +++++++++++++++++++++++
 1 file changed, 179 insertions(+)

diff --git a/lib/portage/tests/resolver/test_unmerge_order.py b/lib/portage/tests/resolver/test_unmerge_order.py
new file mode 100644
index 000000000..298bfd9ea
--- /dev/null
+++ b/lib/portage/tests/resolver/test_unmerge_order.py
@@ -0,0 +1,179 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+import os
+
+from _emerge.unmerge import _unmerge_display
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import ResolverPlayground
+
+class _TestData:
+	def __init__(self, unmerge_files, expected_pkgmap):
+		self.unmerge_files = unmerge_files
+
+		# The pkgmap created by unmerge_display is a list where each entry is of the form
+		# {"selected": list(...), "omitted": set(...), "protected": set(...) }.
+		# To simplify the notation of the test data, we receive a list with entries of the form
+		# (s1,o1)
+		# The entries are then translated to the expected form:
+		# {"selected": s1, "omitted": o1, "protected": set()}
+		# The "protected" field is not relevant for testing ordering.
+		# The ordering of the "omitted" field is not relevant.
+		expand = lambda x: {"selected": x[0], "omitted": set(x[1]), "protected": set()}
+		self.expected_pkgmap = list(map(expand, expected_pkgmap))
+
+class UnmergeOrderTestCase(TestCase):
+
+	def testUnmergeOrder(self):
+		ebuilds = {
+			"c/x-1": {},
+
+			"c/y-2": {},
+			"c/y-3": {},
+
+			"c/z-4": {},
+			"c/z-5": {},
+			"c/z-6": {},
+
+			"c/zz-4": {},
+			"c/zz-5": {},
+			"c/zz-6": {},
+		}
+		installed = {
+			"c/x-1": {},
+
+			"c/y-2": {},
+
+			"c/z-4": {},
+			"c/z-5": {},
+			"c/z-6": {},
+
+			"c/zz-4": {},
+			"c/zz-5": {},
+			"c/zz-6": {},
+		}
+		test_cases = (
+
+			# cp = category/package
+			# cpv = category/package-version
+
+			# Single cpv atom, representing the only available instance of the cp.
+			# The pkgmap should contain exactly that cpv and no omitted packages.
+			_TestData(["c/x-1"], [ (["c/x-1"],[]) ]),
+
+			# Single cp atom. The pkgmap should contain the only available cpv to
+			# which the cp expands, no omitted packages.
+			_TestData(["c/x"], [ (["c/x-1"],[]) ]),
+
+			# Duplicate cpv atom, representing the only available instance of the cp.
+			# The pkgmap should contain the cpv with no omitted packages, and an empty
+			# entry representing the duplicate.
+			_TestData(["c/x-1", "c/x-1"], [ (["c/x-1"],[]), ([],[]) ]),
+
+			# Duplicate cp atom, representing the only available instance. The pkgmap
+			# should contain the only available cpv to which the cp expands, with no
+			# omitted packages, and a second empty entry representing the duplicate.
+			_TestData(["c/x", "c/x"], [ (["c/x-1"],[]), ([],[]) ]),
+
+			# Single cpv atom, representing one of the two available instances. The
+			# pkgmap should contain exactly that cpv. Since the other instance is not
+			# installed, there should be no omitted packages.
+			_TestData(["c/y-2"], [ (["c/y-2"],[]) ]),
+
+			# Single cp atom. The pkgmap should contain exactly the only installed
+			# instance and no omitted packages.
+			_TestData(["c/y"], [ (["c/y-2"],[]) ]),
+
+			# Single cpv atom, representing one of the three available instances.
+			# The pkgmap should contain exactly the cpv. Since all three instances
+			# are installed, the other two instances should be in the omitted packages.
+			_TestData(["c/z-4"], [ (["c/z-4"],["c/z-5","c/z-6"]) ]),
+
+			# Single cp atom. The pkgmap should contain all three installed instances.
+			# Since there are no other installed instances, there should be no omitted
+			# packages.
+			_TestData(["c/z"], [ (["c/z-4","c/z-5","c/z-6"],[]) ]),
+
+			# Two cpv atoms belonging to the same cp. The pkgmap should contain an
+			# entry for each cpv, in the same order. The third installed cpv belonging
+			# to the cp should be listed in the omitted section of each entry.
+			_TestData(["c/z-4","c/z-5"], [ (["c/z-4"],["c/z-6"]), (["c/z-5"],["c/z-6"]) ]),
+			_TestData(["c/z-5","c/z-4"], [ (["c/z-5"],["c/z-6"]), (["c/z-4"],["c/z-6"]) ]),
+
+			# Three cpv atoms belonging to the same cp. The pkgmap should contain an
+			# entry for each cpv, in the same order. Since there are no other instances
+			# of the cp, the omitted section of each entry should be empty.
+			_TestData(["c/z-4","c/z-5","c/z-6"], [ (["c/z-4"],[]), (["c/z-5"],[]), (["c/z-6"],[]) ]),
+			_TestData(["c/z-6","c/z-5","c/z-4"], [ (["c/z-6"],[]), (["c/z-5"],[]), (["c/z-4"],[]) ]),
+
+			# First a cp atom, then a cpv atom that is an instance of the cp. The
+			# pkgmap should contain an entry containing all installed cpv's that the cp
+			# expands to, in sorted order. It should then contain an empty entry
+			# representing the input cpv that is already covered by the expansion of
+			# the cp.
+			_TestData(["c/z","c/z-4"], [ (["c/z-4","c/z-5","c/z-6"],[]), ([],[]) ]),
+			_TestData(["c/z","c/z-6"], [ (["c/z-4","c/z-5","c/z-6"],[]), ([],[]) ]),
+
+			# First a cpv atom, then the cp to which the cpv belongs. The pkgmap
+			# should contain an entry for the first cpv, then an entry containing
+			# the remaining cpv's to which the cp expands.
+			_TestData(["c/z-4","c/z"], [ (["c/z-4"],[]), (["c/z-5","c/z-6"],[]) ]),
+			_TestData(["c/z-6","c/z"], [ (["c/z-6"],[]), (["c/z-4","c/z-5"],[]) ]),
+
+			# More mixed cp/cpv's. The cp should expand to all cpv's except those
+			# covered by a preceding cpv. The cpv's after the cp should result in empty
+			# entries, since they are already covered by the expansion of the cp.
+			_TestData(["c/z","c/z-4","c/z-5"], [ (["c/z-4","c/z-5","c/z-6"],[]), ([],[]), ([],[]) ]),
+			_TestData(["c/z","c/z-5","c/z-4"], [ (["c/z-4","c/z-5","c/z-6"],[]), ([],[]), ([],[]) ]),
+			_TestData(["c/z-4","c/z","c/z-5"], [ (["c/z-4"],[]), (["c/z-5","c/z-6"],[]), ([],[]) ]),
+			_TestData(["c/z-5","c/z","c/z-4"], [ (["c/z-5"],[]), (["c/z-4","c/z-6"],[]), ([],[]) ]),
+			_TestData(["c/z-4","c/z-5","c/z"], [ (["c/z-4"],[]), (["c/z-5"],[]), (["c/z-6"],[]) ]),
+			_TestData(["c/z-5","c/z-4","c/z"], [ (["c/z-5"],[]), (["c/z-4"],[]), (["c/z-6"],[]) ]),
+			_TestData(["c/z","c/z-4","c/z-5","c/z-6"], [ (["c/z-4","c/z-5","c/z-6"],[]), ([],[]), ([],[]), ([],[]) ]),
+			_TestData(["c/z","c/z-6","c/z-5","c/z-4"], [ (["c/z-4","c/z-5","c/z-6"],[]), ([],[]), ([],[]), ([],[]) ]),
+			_TestData(["c/z-4","c/z","c/z-5","c/z-6"], [ (["c/z-4"],[]), (["c/z-5","c/z-6"],[]), ([],[]), ([],[]) ]),
+			_TestData(["c/z-6","c/z","c/z-5","c/z-4"], [ (["c/z-6"],[]), (["c/z-4","c/z-5"],[]), ([],[]), ([],[]) ]),
+			_TestData(["c/z-4","c/z-5","c/z","c/z-6"], [ (["c/z-4"],[]), (["c/z-5"],[]), (["c/z-6"],[]), ([],[]) ]),
+			_TestData(["c/z-6","c/z-5","c/z","c/z-4"], [ (["c/z-6"],[]), (["c/z-5"],[]), (["c/z-4"],[]), ([],[]) ]),
+			_TestData(["c/z-4","c/z-5","c/z-6","c/z"], [ (["c/z-4"],[]), (["c/z-5"],[]), (["c/z-6"],[]), ([],[]) ]),
+			_TestData(["c/z-6","c/z-5","c/z-4","c/z"], [ (["c/z-6"],[]), (["c/z-5"],[]), (["c/z-4"],[]), ([],[]) ]),
+
+			# Two cpv that do not belong to the same cp. The pkgmap should contain an
+			# entry for each cpv, in the same order. If there are other installed
+			# instances of the cp to which the cpv belongs, they should be listed
+			# in the omitted section.
+			_TestData(["c/x-1","c/y-2"], [ (["c/x-1"],[]), (["c/y-2"],[]) ]),
+			_TestData(["c/y-2","c/x-1"], [ (["c/y-2"],[]), (["c/x-1"],[]) ]),
+			_TestData(["c/x-1","c/z-4"], [ (["c/x-1"],[]), (["c/z-4"],["c/z-5","c/z-6"]) ]),
+			_TestData(["c/z-4","c/x-1"], [ (["c/z-4"],["c/z-5","c/z-6"]), (["c/x-1"],[]) ]),
+
+			# cpv's/cp where some cpv's are not instances of the cp. The pkgmap should
+			# contain an entry for each in the same order, with the cp expanded
+			# to all installed instances.
+			_TestData(["c/x-1","c/z"], [ (["c/x-1"],[]), (["c/z-4","c/z-5","c/z-6"],[]) ]),
+			_TestData(["c/z","c/x-1"], [ (["c/z-4","c/z-5","c/z-6"],[]), (["c/x-1"],[]) ]),
+			_TestData(["c/x-1","c/z-4","c/z"], [ (["c/x-1"],[]), (["c/z-4"],[]), (["c/z-5","c/z-6"],[]) ]),
+			_TestData(["c/z-4","c/z","c/x-1"], [ (["c/z-4"],[]), (["c/z-5","c/z-6"],[]), (["c/x-1"],[]) ]),
+			_TestData(["c/x-1","c/z","c/z-4"], [ (["c/x-1"],[]), (["c/z-4","c/z-5","c/z-6"],[]), ([],[]) ]),
+			_TestData(["c/z","c/z-4","c/x-1"], [ (["c/z-4","c/z-5","c/z-6"],[]), ([],[]), (["c/x-1"],[]) ]),
+
+			# Two different cp's. The pkglist should contain an entry for each cp,
+			# in the same order, containing all cpv's that the cp's expands to.
+			_TestData(["c/z","c/zz"], [ (["c/z-4","c/z-5","c/z-6"],[]), (["c/zz-4","c/zz-5","c/zz-6"],[]) ]),
+			_TestData(["c/zz","c/z"], [ (["c/zz-4","c/zz-5","c/zz-6"],[]), (["c/z-4","c/z-5","c/z-6"],[]) ]),
+		)
+
+		playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)
+
+		try:
+			for test_case in test_cases:
+				eroot = playground.settings['EROOT']
+				root_config = playground.trees[eroot]["root_config"]
+
+				res, pkgmap = _unmerge_display(root_config, [], "unmerge", test_case.unmerge_files, ordered=True)
+
+				self.assertEqual(res, os.EX_OK)
+				self.assertEqual(pkgmap, test_case.expected_pkgmap)
+		finally:
+			playground.cleanup()


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2021-03-28  6:21 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2021-03-28  6:21 UTC (permalink / raw
  To: gentoo-commits

commit:     a86016cb736f0da83fa88031d66192f28edd3c96
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 28 06:12:13 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Mar 28 06:20:20 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a86016cb

ResolverPlayground: enable package.use.{force,mask}

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/ResolverPlayground.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/portage/tests/resolver/ResolverPlayground.py b/lib/portage/tests/resolver/ResolverPlayground.py
index 89feea47a..4575156f2 100644
--- a/lib/portage/tests/resolver/ResolverPlayground.py
+++ b/lib/portage/tests/resolver/ResolverPlayground.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2020 Gentoo Authors
+# Copyright 2010-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import bz2
@@ -44,7 +44,13 @@ class ResolverPlayground:
 	config_files = frozenset(("eapi", "layout.conf", "make.conf", "modules", "package.accept_keywords",
 		"package.keywords", "package.license", "package.mask", "package.properties",
 		"package.provided", "packages",
-		"package.unmask", "package.use", "package.use.aliases", "package.use.stable.mask",
+		"package.unmask",
+		"package.use",
+		"package.use.aliases",
+		"package.use.force",
+		"package.use.mask",
+		"package.use.stable.force",
+		"package.use.stable.mask",
 		"soname.provided",
 		"unpack_dependencies", "use.aliases", "use.force", "use.mask", "layout.conf"))
 


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2021-03-06  9:53 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2021-03-06  9:53 UTC (permalink / raw
  To: gentoo-commits

commit:     a607bed25cb7d9cad7ef9533879b5ab93c94277c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  6 09:51:33 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar  6 09:52:52 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a607bed2

Remove unit tests for deprecated EAPI-progress

Fixes: 67cf9c2b0504 ("Mark EAPIs 4-python and 5-progress as deprecated")
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 .../tests/resolver/test_unpack_dependencies.py     |  65 ----------
 lib/portage/tests/resolver/test_use_aliases.py     | 131 ---------------------
 2 files changed, 196 deletions(-)

diff --git a/lib/portage/tests/resolver/test_unpack_dependencies.py b/lib/portage/tests/resolver/test_unpack_dependencies.py
deleted file mode 100644
index cfceff4b1..000000000
--- a/lib/portage/tests/resolver/test_unpack_dependencies.py
+++ /dev/null
@@ -1,65 +0,0 @@
-# Copyright 2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-from portage.tests import TestCase
-from portage.tests.resolver.ResolverPlayground import ResolverPlayground, ResolverPlaygroundTestCase
-
-class UnpackDependenciesTestCase(TestCase):
-	def testUnpackDependencies(self):
-		distfiles = {
-			"A-1.tar.gz": b"binary\0content",
-			"B-1.TAR.XZ": b"binary\0content",
-			"B-docs-1.tar.bz2": b"binary\0content",
-			"C-1.TAR.XZ": b"binary\0content",
-			"C-docs-1.tar.bz2": b"binary\0content",
-		}
-
-		ebuilds = {
-			"dev-libs/A-1": {"SRC_URI": "A-1.tar.gz", "EAPI": "5-progress"},
-			"dev-libs/B-1": {"IUSE": "doc", "SRC_URI": "B-1.TAR.XZ doc? ( B-docs-1.tar.bz2 )", "EAPI": "5-progress"},
-			"dev-libs/C-1": {"IUSE": "doc", "SRC_URI": "C-1.TAR.XZ doc? ( C-docs-1.tar.bz2 )", "EAPI": "5-progress"},
-			"app-arch/bzip2-1": {},
-			"app-arch/gzip-1": {},
-			"app-arch/tar-1": {},
-			"app-arch/xz-utils-1": {},
-		}
-
-		repo_configs = {
-			"test_repo": {
-				"unpack_dependencies/5-progress": (
-					"tar.bz2 app-arch/tar app-arch/bzip2",
-					"tar.gz app-arch/tar app-arch/gzip",
-					"tar.xz app-arch/tar app-arch/xz-utils",
-				),
-			},
-		}
-
-		test_cases = (
-			ResolverPlaygroundTestCase(
-				["dev-libs/A"],
-				success = True,
-				ignore_mergelist_order = True,
-				mergelist = ["app-arch/tar-1", "app-arch/gzip-1", "dev-libs/A-1"]),
-			ResolverPlaygroundTestCase(
-				["dev-libs/B"],
-				success = True,
-				ignore_mergelist_order = True,
-				mergelist = ["app-arch/tar-1", "app-arch/xz-utils-1", "dev-libs/B-1"]),
-			ResolverPlaygroundTestCase(
-				["dev-libs/C"],
-				success = True,
-				ignore_mergelist_order = True,
-				mergelist = ["app-arch/tar-1", "app-arch/xz-utils-1", "app-arch/bzip2-1", "dev-libs/C-1"]),
-		)
-
-		user_config = {
-			"package.use": ("dev-libs/C doc",)
-		}
-
-		playground = ResolverPlayground(distfiles=distfiles, ebuilds=ebuilds, repo_configs=repo_configs, user_config=user_config)
-		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.cleanup()

diff --git a/lib/portage/tests/resolver/test_use_aliases.py b/lib/portage/tests/resolver/test_use_aliases.py
deleted file mode 100644
index 7c2debbb1..000000000
--- a/lib/portage/tests/resolver/test_use_aliases.py
+++ /dev/null
@@ -1,131 +0,0 @@
-# Copyright 2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-from portage.tests import TestCase
-from portage.tests.resolver.ResolverPlayground import ResolverPlayground, ResolverPlaygroundTestCase
-
-class UseAliasesTestCase(TestCase):
-	def testUseAliases(self):
-		ebuilds = {
-			"dev-libs/A-1": {"DEPEND": "dev-libs/K[x]", "RDEPEND": "dev-libs/K[x]", "EAPI": "5"},
-			"dev-libs/B-1": {"DEPEND": "dev-libs/L[x]", "RDEPEND": "dev-libs/L[x]", "EAPI": "5"},
-			"dev-libs/C-1": {"DEPEND": "dev-libs/M[xx]", "RDEPEND": "dev-libs/M[xx]", "EAPI": "5"},
-			"dev-libs/D-1": {"DEPEND": "dev-libs/N[-x]", "RDEPEND": "dev-libs/N[-x]", "EAPI": "5"},
-			"dev-libs/E-1": {"DEPEND": "dev-libs/O[-xx]", "RDEPEND": "dev-libs/O[-xx]", "EAPI": "5"},
-			"dev-libs/F-1": {"DEPEND": "dev-libs/P[-xx]", "RDEPEND": "dev-libs/P[-xx]", "EAPI": "5"},
-			"dev-libs/G-1": {"DEPEND": "dev-libs/Q[x-y]", "RDEPEND": "dev-libs/Q[x-y]", "EAPI": "5"},
-			"dev-libs/H-1": {"DEPEND": "=dev-libs/R-1*[yy]", "RDEPEND": "=dev-libs/R-1*[yy]", "EAPI": "5"},
-			"dev-libs/H-2": {"DEPEND": "=dev-libs/R-2*[yy]", "RDEPEND": "=dev-libs/R-2*[yy]", "EAPI": "5"},
-			"dev-libs/I-1": {"DEPEND": "dev-libs/S[y-z]", "RDEPEND": "dev-libs/S[y-z]", "EAPI": "5"},
-			"dev-libs/I-2": {"DEPEND": "dev-libs/S[y_z]", "RDEPEND": "dev-libs/S[y_z]", "EAPI": "5"},
-			"dev-libs/J-1": {"DEPEND": "dev-libs/T[x]", "RDEPEND": "dev-libs/T[x]", "EAPI": "5"},
-			"dev-libs/K-1": {"IUSE": "+x", "EAPI": "5"},
-			"dev-libs/K-2::repo1": {"IUSE": "+X", "EAPI": "5-progress"},
-			"dev-libs/L-1": {"IUSE": "+x", "EAPI": "5"},
-			"dev-libs/M-1::repo1": {"IUSE": "X", "EAPI": "5-progress"},
-			"dev-libs/N-1": {"IUSE": "x", "EAPI": "5"},
-			"dev-libs/N-2::repo1": {"IUSE": "X", "EAPI": "5-progress"},
-			"dev-libs/O-1": {"IUSE": "x", "EAPI": "5"},
-			"dev-libs/P-1::repo1": {"IUSE": "+X", "EAPI": "5-progress"},
-			"dev-libs/Q-1::repo2": {"IUSE": "X.Y", "EAPI": "5-progress"},
-			"dev-libs/R-1::repo1": {"IUSE": "Y", "EAPI": "5-progress"},
-			"dev-libs/R-2::repo1": {"IUSE": "y", "EAPI": "5-progress"},
-			"dev-libs/S-1::repo2": {"IUSE": "Y.Z", "EAPI": "5-progress"},
-			"dev-libs/S-2::repo2": {"IUSE": "Y.Z", "EAPI": "5-progress"},
-			"dev-libs/T-1::repo1": {"IUSE": "+X", "EAPI": "5"},
-		}
-
-		installed = {
-			"dev-libs/L-2::repo1": {"IUSE": "+X", "USE": "X", "EAPI": "5-progress"},
-			"dev-libs/O-2::repo1": {"IUSE": "X", "USE": "", "EAPI": "5-progress"},
-		}
-
-		repo_configs = {
-			"repo1": {
-				"use.aliases": ("X x xx",),
-				"package.use.aliases": (
-					"=dev-libs/R-1* Y yy",
-					"=dev-libs/R-2* y yy",
-				)
-			},
-			"repo2": {
-				"eapi": ("5-progress",),
-				"use.aliases": ("X.Y x-y",),
-				"package.use.aliases": (
-					"=dev-libs/S-1* Y.Z y-z",
-					"=dev-libs/S-2* Y.Z y_z",
-				),
-			},
-		}
-
-		test_cases = (
-			ResolverPlaygroundTestCase(
-				["dev-libs/A"],
-				success = True,
-				mergelist = ["dev-libs/K-2", "dev-libs/A-1"]),
-			ResolverPlaygroundTestCase(
-				["dev-libs/B"],
-				success = True,
-				mergelist = ["dev-libs/B-1"]),
-			ResolverPlaygroundTestCase(
-				["dev-libs/C"],
-				options = {"--autounmask": True},
-				success = False,
-				mergelist = ["dev-libs/M-1", "dev-libs/C-1"],
-				use_changes = {"dev-libs/M-1": {"X": True}}),
-			ResolverPlaygroundTestCase(
-				["dev-libs/D"],
-				success = True,
-				mergelist = ["dev-libs/N-2", "dev-libs/D-1"]),
-			ResolverPlaygroundTestCase(
-				["dev-libs/E"],
-				success = True,
-				mergelist = ["dev-libs/E-1"]),
-			ResolverPlaygroundTestCase(
-				["dev-libs/F"],
-				options = {"--autounmask": True},
-				success = False,
-				mergelist = ["dev-libs/P-1", "dev-libs/F-1"],
-				use_changes = {"dev-libs/P-1": {"X": False}}),
-			ResolverPlaygroundTestCase(
-				["dev-libs/G"],
-				options = {"--autounmask": True},
-				success = False,
-				mergelist = ["dev-libs/Q-1", "dev-libs/G-1"],
-				use_changes = {"dev-libs/Q-1": {"X.Y": True}}),
-			ResolverPlaygroundTestCase(
-				["=dev-libs/H-1*"],
-				options = {"--autounmask": True},
-				success = False,
-				mergelist = ["dev-libs/R-1", "dev-libs/H-1"],
-				use_changes = {"dev-libs/R-1": {"Y": True}}),
-			ResolverPlaygroundTestCase(
-				["=dev-libs/H-2*"],
-				options = {"--autounmask": True},
-				success = False,
-				mergelist = ["dev-libs/R-2", "dev-libs/H-2"],
-				use_changes = {"dev-libs/R-2": {"y": True}}),
-			ResolverPlaygroundTestCase(
-				["=dev-libs/I-1*"],
-				options = {"--autounmask": True},
-				success = False,
-				mergelist = ["dev-libs/S-1", "dev-libs/I-1"],
-				use_changes = {"dev-libs/S-1": {"Y.Z": True}}),
-			ResolverPlaygroundTestCase(
-				["=dev-libs/I-2*"],
-				options = {"--autounmask": True},
-				success = False,
-				mergelist = ["dev-libs/S-2", "dev-libs/I-2"],
-				use_changes = {"dev-libs/S-2": {"Y.Z": True}}),
-			ResolverPlaygroundTestCase(
-				["dev-libs/J"],
-				success = False),
-		)
-
-		playground = ResolverPlayground(ebuilds=ebuilds, installed=installed, repo_configs=repo_configs)
-		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.cleanup()


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2021-03-01  8:56 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2021-03-01  8:56 UTC (permalink / raw
  To: gentoo-commits

commit:     2c322a4274fafcc04423baecd6880737e1639168
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar  1 07:58:33 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar  1 08:55:18 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2c322a42

Include --autounmask-backtrack in unit test for bug 773469

The --autounmask-backtrack option is needed in order to trigger
the --binpkg-respect-use=y behavior that appears confusingly
similar to --binpkg-respect-use=n behavior.

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

 lib/portage/tests/resolver/test_useflags.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/portage/tests/resolver/test_useflags.py b/lib/portage/tests/resolver/test_useflags.py
index 7439dc306..d66da0866 100644
--- a/lib/portage/tests/resolver/test_useflags.py
+++ b/lib/portage/tests/resolver/test_useflags.py
@@ -46,13 +46,15 @@ class UseFlagsTestCase(TestCase):
 				success = True,
 				mergelist = ["dev-libs/A-1"]),
 
-			# Bug 773469 - Demonstrate --autounmask-use interference with --binpkg-respect-use=y
+			# In the unit test case for bug 773469, the --autounmask-backtrack option
+			# is needed in order to trigger the --binpkg-respect-use=y behavior that
+			# appears confusingly similar to --binpkg-respect-use=n behavior.
 			ResolverPlaygroundTestCase(
 				["dev-libs/C", "dev-libs/D"],
-				options={"--usepkg": True, "--binpkg-respect-use": "y"},
-				success=False,
+				options={"--usepkg": True, "--binpkg-respect-use": "y", "--autounmask-backtrack": "y"},
+				success=True,
 				use_changes={"dev-libs/C-1": {"abi_x86_32": True}},
-				mergelist=["dev-libs/C-1", "[binary]dev-libs/D-1"],
+				mergelist=["[binary]dev-libs/C-1", "[binary]dev-libs/D-1"],
 			),
 
 			#--binpkg-respect-use=n: use binpkgs with different use flags


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2021-03-01  6:43 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2021-03-01  6:43 UTC (permalink / raw
  To: gentoo-commits

commit:     7a683809e4f7f61590a770df7f79cfa633a18d8e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar  1 06:36:29 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar  1 06:40:26 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7a683809

Add unit test demonstrating --autounmask-use / --binpkg-respect-use=y conflict

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

 lib/portage/tests/resolver/test_useflags.py | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/lib/portage/tests/resolver/test_useflags.py b/lib/portage/tests/resolver/test_useflags.py
index 0a5f3b3ff..7439dc306 100644
--- a/lib/portage/tests/resolver/test_useflags.py
+++ b/lib/portage/tests/resolver/test_useflags.py
@@ -10,17 +10,24 @@ class UseFlagsTestCase(TestCase):
 		ebuilds = {
 			"dev-libs/A-1": { "IUSE": "X", },
 			"dev-libs/B-1": { "IUSE": "X Y", },
+			"dev-libs/C-1": { "IUSE": "abi_x86_32", "EAPI": "7" },
+			"dev-libs/D-1": { "IUSE": "abi_x86_32", "EAPI": "7", "RDEPEND": "dev-libs/C[abi_x86_32?]" },
 			}
 
 		installed = {
 			"dev-libs/A-1": { "IUSE": "X", },
 			"dev-libs/B-1": { "IUSE": "X", },
+			"dev-libs/C-1": { "IUSE": "abi_x86_32", "USE": "abi_x86_32", "EAPI": "7" },
+			"dev-libs/D-1": { "IUSE": "abi_x86_32", "USE": "abi_x86_32", "EAPI": "7", "RDEPEND": "dev-libs/C[abi_x86_32]" },
 			}
 
 		binpkgs = installed
 
 		user_config = {
-			"package.use": ( "dev-libs/A X", ),
+			"package.use": (
+				"dev-libs/A X",
+				"dev-libs/D abi_x86_32",
+			),
 			"use.force": ( "Y", ),
 		}
 
@@ -39,6 +46,15 @@ class UseFlagsTestCase(TestCase):
 				success = True,
 				mergelist = ["dev-libs/A-1"]),
 
+			# Bug 773469 - Demonstrate --autounmask-use interference with --binpkg-respect-use=y
+			ResolverPlaygroundTestCase(
+				["dev-libs/C", "dev-libs/D"],
+				options={"--usepkg": True, "--binpkg-respect-use": "y"},
+				success=False,
+				use_changes={"dev-libs/C-1": {"abi_x86_32": True}},
+				mergelist=["dev-libs/C-1", "[binary]dev-libs/D-1"],
+			),
+
 			#--binpkg-respect-use=n: use binpkgs with different use flags
 			ResolverPlaygroundTestCase(
 				["dev-libs/A"],


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2021-02-23 22:39 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2021-02-23 22:39 UTC (permalink / raw
  To: gentoo-commits

commit:     f5a58b3f2e2adc7f9d2794d4e91d44ec1419b56a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 23 22:14:30 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 23 22:37:34 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f5a58b3f

Add USE conflict unit test for bug 615824

Test bug 615824, where an automask USE change results in
a conflict which is not reported. In order to install L,
foo must be disabled for both K and M, but autounmask
disables foo for K and leaves it enabled for M:

[ebuild  N     ] sci-libs/K-1  USE="-foo"
[ebuild  N     ] sci-libs/L-1
[ebuild  N     ] sci-libs/M-1  USE="foo"

The following USE changes are necessary to proceed:
 (see "package.use" in the portage(5) man page for more details)
# required by sci-libs/L-1::test_repo
# required by sci-libs/L (argument)
>=sci-libs/K-1 -foo

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

 .../resolver/test_autounmask_use_slot_conflict.py  | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/lib/portage/tests/resolver/test_autounmask_use_slot_conflict.py b/lib/portage/tests/resolver/test_autounmask_use_slot_conflict.py
new file mode 100644
index 000000000..2e090d45e
--- /dev/null
+++ b/lib/portage/tests/resolver/test_autounmask_use_slot_conflict.py
@@ -0,0 +1,51 @@
+# Copyright 2017-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (
+	ResolverPlayground,
+	ResolverPlaygroundTestCase,
+)
+
+
+class AutounmaskUseSlotConflictTestCase(TestCase):
+	def testAutounmaskUseSlotConflict(self):
+		self.todo = True
+
+		ebuilds = {
+			"sci-libs/K-1": {"IUSE": "+foo", "EAPI": 1},
+			"sci-libs/L-1": {"DEPEND": "sci-libs/K[-foo]", "EAPI": 2},
+			"sci-libs/M-1": {"DEPEND": "sci-libs/K[foo=]", "IUSE": "+foo", "EAPI": 2},
+		}
+
+		installed = {}
+
+		test_cases = (
+			# Test bug 615824, where an automask USE change results in
+			# a conflict which is not reported. In order to install L,
+			# foo must be disabled for both K and M, but autounmask
+			# disables foo for K and leaves it enabled for M.
+			ResolverPlaygroundTestCase(
+				["sci-libs/L", "sci-libs/M"],
+				options={"--backtrack": 0},
+				success=False,
+				mergelist=[
+					"sci-libs/L-1",
+					"sci-libs/M-1",
+					"sci-libs/K-1",
+				],
+				ignore_mergelist_order=True,
+				slot_collision_solutions=[
+					{"sci-libs/K-1": {"foo": False}, "sci-libs/M-1": {"foo": False}}
+				],
+			),
+		)
+
+		playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)
+		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()


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2021-01-11  3:40 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2021-01-11  3:40 UTC (permalink / raw
  To: gentoo-commits

commit:     9b6417f527aa98742a51d7859051342b6fb1383f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 11 01:57:44 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jan 11 03:04:28 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9b6417f5

Add unit test demonstrating bug 764764

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

 .../resolver/test_slot_operator_reverse_deps.py    | 98 +++++++++++++++++++++-
 1 file changed, 97 insertions(+), 1 deletion(-)

diff --git a/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py b/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py
index 6641e9987..6e7214043 100644
--- a/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py
+++ b/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py
@@ -1,4 +1,4 @@
-# Copyright 2016-2020 Gentoo Authors
+# Copyright 2016-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase
@@ -202,3 +202,99 @@ class SlotOperatorReverseDepsLibGit2TestCase(TestCase):
 		finally:
 			playground.debug = False
 			playground.cleanup()
+
+
+class SlotOperatorReverseDepsVirtualTestCase(TestCase):
+
+	def testSlotOperatorReverseDepsVirtual(self):
+		"""
+		Demonstrate bug #764764, where slot operator rebuilds were
+		not triggered for reverse deps of virtual/dist-kernel.
+		"""
+
+		ebuilds = {
+
+			"app-emulation/virtualbox-modules-6.1.16-r1": {
+				"EAPI": "7",
+				"DEPEND": "virtual/dist-kernel",
+				"RDEPEND": "virtual/dist-kernel:=",
+			},
+
+			"sys-kernel/gentoo-kernel-5.10.6": {
+				"EAPI": "7",
+				"SLOT": "5.10.6",
+			},
+
+			"sys-kernel/gentoo-kernel-5.10.5": {
+				"EAPI": "7",
+				"SLOT": "5.10.5",
+			},
+
+			"virtual/dist-kernel-5.10.5" : {
+				"EAPI": "7",
+				"SLOT": "0/5.10.5",
+				"RDEPEND": "~sys-kernel/gentoo-kernel-5.10.5",
+			},
+
+			"virtual/dist-kernel-5.10.6" : {
+				"EAPI": "7",
+				"SLOT": "0/5.10.6",
+				"RDEPEND": "~sys-kernel/gentoo-kernel-5.10.6"
+			},
+
+			"x11-drivers/nvidia-drivers-460.32.03" : {
+				"EAPI": "7",
+				"DEPEND": "virtual/dist-kernel",
+				"RDEPEND": "virtual/dist-kernel:=",
+			},
+
+		}
+
+		installed = {
+
+			"app-emulation/virtualbox-modules-6.1.16-r1": {
+				"EAPI": "7",
+				"DEPEND": "virtual/dist-kernel",
+				"RDEPEND": "virtual/dist-kernel:0/5.10.5=",
+			},
+
+			"sys-kernel/gentoo-kernel-5.10.5": {
+				"EAPI": "7",
+				"SLOT": "5.10.5",
+			},
+
+			"virtual/dist-kernel-5.10.5" : {
+				"EAPI": "7",
+				"SLOT": "0/5.10.5",
+				"RDEPEND": "~sys-kernel/gentoo-kernel-5.10.5"
+			},
+
+			"x11-drivers/nvidia-drivers-460.32.03" : {
+				"EAPI": "7",
+				"DEPEND": "virtual/dist-kernel",
+				"RDEPEND": "virtual/dist-kernel:0/5.10.5="
+			},
+
+		}
+
+		world = ["app-emulation/virtualbox-modules", "x11-drivers/nvidia-drivers"]
+
+		test_cases = (
+			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()


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2020-12-02 17:33 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2020-12-02 17:33 UTC (permalink / raw
  To: gentoo-commits

commit:     c1671591dc2b46038c871f9038ff4cb46dccc160
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Dec  2 17:28:45 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Dec  2 17:32:36 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c1671591

MergeOrderTestCase: fix x11-drivers/xf86-video-fbdev slot operator deps

The real ebuild has the x11-base/xorg-server:= dependency in RDEPEND
rather than DEPEND.

Fixes: 07a604537e74 ("find_smallest_cycle: don't merge satisfied PDEPEND too early")
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/test_merge_order.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/portage/tests/resolver/test_merge_order.py b/lib/portage/tests/resolver/test_merge_order.py
index 0510a0636..db063ed9d 100644
--- a/lib/portage/tests/resolver/test_merge_order.py
+++ b/lib/portage/tests/resolver/test_merge_order.py
@@ -231,8 +231,8 @@ class MergeOrderTestCase(TestCase):
 			},
 			"x11-drivers/xf86-video-fbdev-0.5.0-r1": {
 				"EAPI": "7",
-				"DEPEND": "x11-base/xorg-server:=",
-				"RDEPEND": "x11-base/xorg-server",
+				"DEPEND": "x11-base/xorg-server",
+				"RDEPEND": "x11-base/xorg-server:=",
 			}
 		}
 
@@ -325,8 +325,8 @@ class MergeOrderTestCase(TestCase):
 			},
 			"x11-drivers/xf86-video-fbdev-0.5.0-r1": {
 				"EAPI": "7",
-				"DEPEND": "x11-base/xorg-server:0/1.14.1=",
-				"RDEPEND": "x11-base/xorg-server",
+				"DEPEND": "x11-base/xorg-server",
+				"RDEPEND": "x11-base/xorg-server:0/1.14.1=",
 			}
 		}
 


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2020-11-15  5:56 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2020-11-15  5:56 UTC (permalink / raw
  To: gentoo-commits

commit:     e9c0ef7609e8e2068af8c9c7138f1a2dc22fcfb0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 15 04:25:22 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Nov 15 05:54:37 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e9c0ef76

Add slot operator := BDEPEND unit tests for bug 752153

Test these two distinct cases:

1) Regular dev-lang/go upgrade, with rebuild of packages that
have dev-lang/go:= in BDEPEND.

2) Rebuild of packages that have dev-lang/go:= in BDEPEND, after
the built slot operator deps have already been broken by an
earlier dev-lang/go upgrade.

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

 .../tests/resolver/test_slot_operator_bdeps.py     | 209 +++++++++++++++++++++
 1 file changed, 209 insertions(+)

diff --git a/lib/portage/tests/resolver/test_slot_operator_bdeps.py b/lib/portage/tests/resolver/test_slot_operator_bdeps.py
new file mode 100644
index 000000000..f5b1bce1b
--- /dev/null
+++ b/lib/portage/tests/resolver/test_slot_operator_bdeps.py
@@ -0,0 +1,209 @@
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (ResolverPlayground,
+	ResolverPlaygroundTestCase)
+
+class SlotOperatorBdependTestCase(TestCase):
+
+	def testSlotOperatorBdepend(self):
+		"""
+		Test regular dev-lang/go upgrade, with rebuild of packages
+		that have dev-lang/go:= in BDEPEND.
+		"""
+
+		ebuilds = {
+			"app-emulation/buildah-1.16.1":{
+				"EAPI": "7",
+				"BDEPEND": "dev-lang/go:=",
+			},
+
+			"app-emulation/libpod-2.1.0":{
+				"EAPI": "7",
+				"BDEPEND": "dev-lang/go:=",
+			},
+
+			"dev-lang/go-1.15.5":{
+				"EAPI": "7",
+				"SLOT": "0/1.15.5"
+			},
+
+			"dev-lang/go-1.14.12" : {
+				"EAPI": "7",
+				"SLOT": "0/1.14.12"
+			},
+		}
+
+		binpkgs = {
+			"app-emulation/buildah-1.16.1":{
+				"EAPI": "7",
+				"BDEPEND": "dev-lang/go:0/1.14.12=",
+			},
+			"app-emulation/libpod-2.1.0":{
+				"EAPI": "7",
+				"BDEPEND": "dev-lang/go:0/1.14.12=",
+			},
+			"dev-lang/go-1.14.12" : {
+				"EAPI": "7",
+				"SLOT": "0/1.14.12"
+			},
+		}
+
+		installed = {
+			"app-emulation/buildah-1.16.1":{
+				"EAPI": "7",
+				"BDEPEND": "dev-lang/go:0/1.14.12=",
+			},
+			"app-emulation/libpod-2.1.0":{
+				"EAPI": "7",
+				"BDEPEND": "dev-lang/go:0/1.14.12=",
+			},
+			"dev-lang/go-1.14.12" : {
+				"EAPI": "7",
+				"SLOT": "0/1.14.12"
+			},
+		}
+
+		world = ["app-emulation/buildah", "app-emulation/libpod"]
+
+		test_cases = (
+
+			# Test rebuild triggered by slot operator := dependency in BDEPEND.
+			ResolverPlaygroundTestCase(
+				["@world"],
+				options = {
+					"--update": True,
+					"--deep": True,
+				},
+				success = True,
+				mergelist = ["dev-lang/go-1.15.5", "app-emulation/buildah-1.16.1", "app-emulation/libpod-2.1.0"]
+			),
+
+			# Test the above case with --usepkg --with-bdeps=y. It should not use the
+			# binary packages because rebuild is needed.
+			ResolverPlaygroundTestCase(
+				["@world"],
+				options = {
+					"--usepkg": True,
+					"--with-bdeps": "y",
+					"--update": True,
+					"--deep": True,
+				},
+				success = True,
+				mergelist = ["dev-lang/go-1.15.5", "app-emulation/buildah-1.16.1", "app-emulation/libpod-2.1.0"]
+			),
+		)
+
+		playground = ResolverPlayground(ebuilds=ebuilds, binpkgs=binpkgs,
+			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()
+
+	def testSlotOperatorBdependAfterBreakage(self):
+		"""
+		Test rebuild of packages that have dev-lang/go:= in BDEPEND,
+		after the built slot operator deps have already been broken
+		by an earlier dev-lang/go upgrade.
+		"""
+
+		ebuilds = {
+			"app-emulation/buildah-1.16.1":{
+				"EAPI": "7",
+				"BDEPEND": "dev-lang/go:=",
+			},
+
+			"app-emulation/libpod-2.1.0":{
+				"EAPI": "7",
+				"BDEPEND": "dev-lang/go:=",
+			},
+
+			"dev-lang/go-1.15.5":{
+				"EAPI": "7",
+				"SLOT": "0/1.15.5"
+			},
+
+			"dev-lang/go-1.14.12" : {
+				"EAPI": "7",
+				"SLOT": "0/1.14.12"
+			},
+		}
+
+		binpkgs = {
+			"app-emulation/buildah-1.16.1":{
+				"EAPI": "7",
+				"BDEPEND": "dev-lang/go:0/1.14.12=",
+			},
+			"app-emulation/libpod-2.1.0":{
+				"EAPI": "7",
+				"BDEPEND": "dev-lang/go:0/1.14.12=",
+			},
+			"dev-lang/go-1.14.12" : {
+				"EAPI": "7",
+				"SLOT": "0/1.14.12"
+			},
+			"dev-lang/go-1.15.5" : {
+				"EAPI": "7",
+				"SLOT": "0/1.15.5"
+			},
+		}
+
+		installed = {
+			"app-emulation/buildah-1.16.1":{
+				"EAPI": "7",
+				"BDEPEND": "dev-lang/go:0/1.14.12=",
+			},
+			"app-emulation/libpod-2.1.0":{
+				"EAPI": "7",
+				"BDEPEND": "dev-lang/go:0/1.14.12=",
+			},
+			"dev-lang/go-1.15.5" : {
+				"EAPI": "7",
+				"SLOT": "0/1.15.5"
+			},
+		}
+
+		world = ["app-emulation/buildah", "app-emulation/libpod"]
+
+		test_cases = (
+
+			# Test rebuild triggered by slot operator := dependency in BDEPEND.
+			ResolverPlaygroundTestCase(
+				["@world"],
+				options = {
+					"--update": True,
+					"--deep": True,
+				},
+				success = True,
+				mergelist = ["app-emulation/buildah-1.16.1", "app-emulation/libpod-2.1.0"]
+			),
+
+			# Test the above case with --usepkg --with-bdeps=y. It should not use the
+			# binary packages because rebuild is needed.
+			ResolverPlaygroundTestCase(
+				["@world"],
+				options = {
+					"--usepkg": True,
+					"--with-bdeps": "y",
+					"--update": True,
+					"--deep": True,
+				},
+				success = True,
+				mergelist = ["app-emulation/buildah-1.16.1", "app-emulation/libpod-2.1.0"]
+			),
+		)
+
+		playground = ResolverPlayground(ebuilds=ebuilds, binpkgs=binpkgs,
+			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()


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2020-09-19 20:28 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2020-09-19 20:28 UTC (permalink / raw
  To: gentoo-commits

commit:     302a93e5857ff56d43ee0b9dabee9f00d907a8ad
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 13 01:42:30 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep 19 20:22:41 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=302a93e5

Add unit test demonstrating excessive backtracking for bug 743115

Due to excessive backtracking, this test case currently needs
at least --backtrack=21 to succeed.

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

 .../resolver/test_slot_operator_missed_update.py   | 112 +++++++++++++++++++++
 1 file changed, 112 insertions(+)

diff --git a/lib/portage/tests/resolver/test_slot_operator_missed_update.py b/lib/portage/tests/resolver/test_slot_operator_missed_update.py
new file mode 100644
index 000000000..fce012f62
--- /dev/null
+++ b/lib/portage/tests/resolver/test_slot_operator_missed_update.py
@@ -0,0 +1,112 @@
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (
+	ResolverPlayground,
+	ResolverPlaygroundTestCase,
+)
+
+
+class BacktrackMissedUpdateTestCase(TestCase):
+	def testBacktrackMissedUpdateTestCase(self):
+
+		ebuilds = {
+			"dev-lang/python-2.7.18-r2": {
+				"EAPI": "7",
+				"SLOT": "2.7",
+			},
+			"dev-python/pypy3-7.3.2_rc2_p37-r1": {
+				"EAPI": "7",
+				"SLOT": "0/pypy37-pp73",
+			},
+			"dev-python/pypy3-7.3.1-r3": {
+				"EAPI": "7",
+				"SLOT": "0/pypy36-pp73",
+			},
+			"dev-python/setuptools-50.3.0": {
+				"EAPI": "7",
+				"IUSE": "python_targets_pypy3",
+				"RDEPEND": "python_targets_pypy3? ( dev-python/pypy3:= )",
+			},
+			"dev-python/setuptools-50.2.0": {
+				"EAPI": "7",
+				"IUSE": "python_targets_pypy3",
+				"RDEPEND": "python_targets_pypy3? ( dev-python/pypy3:= )",
+			},
+			"dev-python/setuptools-50.1.0": {
+				"EAPI": "7",
+				"IUSE": "python_targets_pypy3",
+				"RDEPEND": "python_targets_pypy3? ( dev-python/pypy3:= )",
+			},
+			"dev-python/setuptools-49.6.0": {
+				"EAPI": "7",
+				"IUSE": "python_targets_pypy3",
+				"RDEPEND": "python_targets_pypy3? ( dev-python/pypy3:= )",
+			},
+			"dev-python/setuptools-46.4.0-r2": {
+				"EAPI": "7",
+				"IUSE": "+python_targets_pypy3 +python_targets_python2_7",
+				"RDEPEND": "python_targets_pypy3? ( dev-python/pypy3:= )",
+			},
+			"dev-lang/python-2.7.18-r2": {
+				"EAPI": "7",
+				"IUSE": "+python_targets_pypy3 +python_targets_python2_7",
+				"RDEPEND": "python_targets_pypy3? ( dev-python/pypy3:= )",
+			},
+			"dev-vcs/mercurial-5.5.1": {
+				"EAPI": "7",
+				"IUSE": "+python_targets_pypy3 +python_targets_python2_7",
+				"RDEPEND": "dev-python/setuptools[python_targets_pypy3?,python_targets_python2_7?] python_targets_python2_7? ( dev-lang/python:2.7 ) python_targets_pypy3? ( dev-python/pypy3:= )",
+			},
+		}
+
+		installed = {
+			"dev-lang/python-2.7.18-r2": {
+				"EAPI": "7",
+				"SLOT": "2.7",
+			},
+			"dev-python/pypy3-7.3.1-r3": {
+				"EAPI": "7",
+				"SLOT": "0/pypy36-pp73",
+			},
+			"dev-python/setuptools-46.4.0-r2": {
+				"EAPI": "7",
+				"IUSE": "+python_targets_pypy3 +python_targets_python2_7",
+				"USE": "python_targets_pypy3 python_targets_python2_7",
+				"RDEPEND": "dev-python/pypy3:0/pypy36-pp73=",
+			},
+			"dev-vcs/mercurial-5.5.1": {
+				"EAPI": "7",
+				"IUSE": "+python_targets_pypy3 +python_targets_python2_7",
+				"USE": "python_targets_pypy3 python_targets_python2_7",
+				"RDEPEND": "dev-python/setuptools[python_targets_pypy3,python_targets_python2_7] dev-python/pypy3:0/pypy36-pp73=",
+			},
+		}
+
+		world = ["dev-vcs/mercurial"]
+
+		test_cases = (
+			# Bug 743115: missed updates trigger excessive backtracking
+			ResolverPlaygroundTestCase(
+				[">=dev-python/pypy3-7.3.2_rc", "@world"],
+				options={"--update": True, "--deep": True, "--backtrack": 25},
+				success=True,
+				mergelist=[
+					"dev-python/pypy3-7.3.2_rc2_p37-r1",
+					"dev-python/setuptools-46.4.0-r2",
+					"dev-vcs/mercurial-5.5.1",
+				],
+			),
+		)
+
+		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()


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2020-08-30 22:39 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2020-08-30 22:39 UTC (permalink / raw
  To: gentoo-commits

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()


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2020-08-03 23:28 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2020-08-03 23:28 UTC (permalink / raw
  To: gentoo-commits

commit:     a791a8a076690ef357939583de6478fe7dd1d3f6
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  3 22:43:04 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug  3 23:28:00 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a791a8a0

lib/portage/tests/resolver/test_slot_collisions.py: fix whitespace

Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/test_slot_collisions.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/portage/tests/resolver/test_slot_collisions.py b/lib/portage/tests/resolver/test_slot_collisions.py
index a15ebf4e0..d84ccfcef 100644
--- a/lib/portage/tests/resolver/test_slot_collisions.py
+++ b/lib/portage/tests/resolver/test_slot_collisions.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2019 Gentoo Authors
+# Copyright 2010-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase
@@ -9,7 +9,7 @@ class SlotCollisionTestCase(TestCase):
 	def testSlotCollision(self):
 
 		ebuilds = {
-			"dev-libs/A-1": { "PDEPEND": "foo? ( dev-libs/B )", "IUSE": "foo" }, 
+			"dev-libs/A-1": { "PDEPEND": "foo? ( dev-libs/B )", "IUSE": "foo" },
 			"dev-libs/B-1": { "IUSE": "foo" },
 			"dev-libs/C-1": { "DEPEND": "dev-libs/A[foo]", "EAPI": 2 },
 			"dev-libs/D-1": { "DEPEND": "dev-libs/A[foo=] dev-libs/B[foo=]", "IUSE": "foo", "EAPI": 2 },
@@ -50,11 +50,11 @@ class SlotCollisionTestCase(TestCase):
 			"dev-lang/perl-5.16": {"SLOT": "0/5.16", "EAPI": "5"},
 			}
 		installed = {
-			"dev-libs/A-1": { "PDEPEND": "foo? ( dev-libs/B )", "IUSE": "foo", "USE": "foo" }, 
+			"dev-libs/A-1": { "PDEPEND": "foo? ( dev-libs/B )", "IUSE": "foo", "USE": "foo" },
 			"dev-libs/B-1": { "IUSE": "foo", "USE": "foo" },
 			"dev-libs/C-1": { "DEPEND": "dev-libs/A[foo]", "EAPI": 2 },
 			"dev-libs/D-1": { "DEPEND": "dev-libs/A[foo=] dev-libs/B[foo=]", "IUSE": "foo", "USE": "foo", "EAPI": 2 },
-			
+
 			"sci-libs/K-1": { "IUSE": "foo", "USE": "" },
 			"sci-libs/L-1": { "DEPEND": "sci-libs/K[-foo]" },
 


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2020-08-03 23:28 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2020-08-03 23:28 UTC (permalink / raw
  To: gentoo-commits

commit:     2351a19ed4406e944eaaa28b1926f70ae2825150
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  3 22:43:05 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug  3 23:28:00 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2351a19e

lib/portage/tests/resolver/test_simple.py: fix whitespace

Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/test_simple.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/portage/tests/resolver/test_simple.py b/lib/portage/tests/resolver/test_simple.py
index 324ffa2a6..b457b9d7a 100644
--- a/lib/portage/tests/resolver/test_simple.py
+++ b/lib/portage/tests/resolver/test_simple.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2012 Gentoo Foundation
+# Copyright 2010-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase
@@ -8,7 +8,7 @@ class SimpleResolverTestCase(TestCase):
 
 	def testSimple(self):
 		ebuilds = {
-			"dev-libs/A-1": { "KEYWORDS": "x86" }, 
+			"dev-libs/A-1": { "KEYWORDS": "x86" },
 			"dev-libs/A-2": { "KEYWORDS": "~x86" },
 			"dev-libs/B-1.2": {},
 


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2020-08-03 21:42 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2020-08-03 21:42 UTC (permalink / raw
  To: gentoo-commits

commit:     649727ede1079a700bf296061287298d28cc1f37
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  3 20:20:29 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug  3 21:25:53 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=649727ed

lib/portage/tests/resolver/ResolverPlayground.py: drop unused-import

* Drop unused-import
* Slight refactor on imports

Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/ResolverPlayground.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/portage/tests/resolver/ResolverPlayground.py b/lib/portage/tests/resolver/ResolverPlayground.py
index b15cc7f36..1e382002a 100644
--- a/lib/portage/tests/resolver/ResolverPlayground.py
+++ b/lib/portage/tests/resolver/ResolverPlayground.py
@@ -2,14 +2,14 @@
 # Distributed under the terms of the GNU General Public License v2
 
 import bz2
-from itertools import permutations
 import fnmatch
 import tempfile
 import portage
+
+from itertools import permutations
 from portage import os
 from portage import shutil
-from portage.const import (GLOBAL_CONFIG_PATH, PORTAGE_BASE_PATH,
-	USER_CONFIG_PATH)
+from portage.const import (GLOBAL_CONFIG_PATH, USER_CONFIG_PATH)
 from portage.process import find_binary
 from portage.dep import Atom, _repo_separator
 from portage.package.ebuild.config import config


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2020-08-03 19:30 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2020-08-03 19:30 UTC (permalink / raw
  To: gentoo-commits

commit:     7cee10a961965b02db75833ac01bac7b2866756f
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  3 19:05:44 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug  3 19:21:27 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7cee10a9

lib/portage/tests/resolver/test_merge_order.py: fix unused-import

Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/test_merge_order.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/portage/tests/resolver/test_merge_order.py b/lib/portage/tests/resolver/test_merge_order.py
index 11752d71e..0003cd7d8 100644
--- a/lib/portage/tests/resolver/test_merge_order.py
+++ b/lib/portage/tests/resolver/test_merge_order.py
@@ -1,7 +1,6 @@
-# Copyright 2011-2019 Gentoo Authors
+# Copyright 2011-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-import portage
 from portage.tests import TestCase
 from portage.tests.resolver.ResolverPlayground import (ResolverPlayground,
 	ResolverPlaygroundTestCase)


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2020-04-11 23:50 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2020-04-11 23:50 UTC (permalink / raw
  To: gentoo-commits

commit:     f049604664bff616b297a5c022b6a8277542eac9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 11 23:45:33 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Apr 11 23:50:21 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f0496046

Add test case to reproduce bug 717140

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

 .../resolver/test_slot_operator_reverse_deps.py    | 94 +++++++++++++++++++++-
 1 file changed, 93 insertions(+), 1 deletion(-)

diff --git a/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py b/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py
index ce614a4dc..5c5295510 100644
--- a/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py
+++ b/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py
@@ -1,4 +1,4 @@
-# Copyright 2016 Gentoo Foundation
+# Copyright 2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase
@@ -111,3 +111,95 @@ class SlotOperatorReverseDepsTestCase(TestCase):
 					test_case.fail_msg)
 		finally:
 			playground.cleanup()
+
+
+class SlotOperatorReverseDepsLibGit2TestCase(TestCase):
+
+	def testSlotOperatorReverseDepsLibGit2(self):
+		"""
+		Test bug #717140, where the depgraph _slot_operator_update_probe
+		method ignored <dev-libs/libgit2-1:0= dependency and tried to
+		trigger an upgrade to dev-libs/libgit2-1.0.0-r1, ultimately
+		resulting in an undesirable downgrade to dev-libs/libgit2-0.28.4-r1.
+		"""
+		self.todo = True
+
+		ebuilds = {
+
+			"dev-libs/libgit2-0.28.4-r1" : {
+				"EAPI": "7",
+				"SLOT": "0/28",
+			},
+
+			"dev-libs/libgit2-0.99.0-r1" : {
+				"EAPI": "7",
+				"SLOT": "0/0.99",
+			},
+
+			"dev-libs/libgit2-1.0.0-r1" : {
+				"EAPI": "7",
+				"SLOT": "0/1.0",
+			},
+
+			"dev-libs/libgit2-glib-0.28.0.1" : {
+				"EAPI": "7",
+				"SLOT": "0",
+				"RDEPEND": "<dev-libs/libgit2-0.29:0= >=dev-libs/libgit2-0.26.0",
+			},
+
+			"dev-libs/libgit2-glib-0.99.0.1" : {
+				"EAPI": "7",
+				"SLOT": "0",
+				"RDEPEND": "<dev-libs/libgit2-1:0= >=dev-libs/libgit2-0.26.0",
+			},
+
+			"dev-vcs/gitg-3.32.1-r1" : {
+				"EAPI": "7",
+				"SLOT": "0",
+				"RDEPEND": "dev-libs/libgit2:= >=dev-libs/libgit2-glib-0.27 <dev-libs/libgit2-glib-1",
+			},
+		}
+
+		installed = {
+
+			"dev-libs/libgit2-0.99.0-r1" : {
+				"EAPI": "7",
+				"SLOT": "0/0.99",
+			},
+
+			"dev-libs/libgit2-glib-0.99.0.1" : {
+				"EAPI": "7",
+				"SLOT": "0",
+				"RDEPEND": "<dev-libs/libgit2-1:0/0.99= >=dev-libs/libgit2-0.26.0",
+			},
+
+			"dev-vcs/gitg-3.32.1-r1" : {
+				"EAPI": "7",
+				"SLOT": "0",
+				"RDEPEND": "dev-libs/libgit2:0/0.99= >=dev-libs/libgit2-glib-0.27 <dev-libs/libgit2-glib-1",
+			},
+
+		}
+
+		world = ["dev-vcs/gitg"]
+
+		test_cases = (
+			ResolverPlaygroundTestCase(
+				["@world"],
+				options = {"--update": True, "--deep": True},
+				success = True,
+				#mergelist = ['dev-libs/libgit2-0.28.4-r1', 'dev-libs/libgit2-glib-0.99.0.1', 'dev-vcs/gitg-3.32.1-r1'],
+				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()


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2020-02-10  3:19 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2020-02-10  3:19 UTC (permalink / raw
  To: gentoo-commits

commit:     240e7124f02a84a572a7a115e9f0df22579e1c55
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 10 03:18:26 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 10 03:18:53 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=240e7124

ResolverPlayground: set PORTAGE_DEBUG=1 for debug mode

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/ResolverPlayground.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/portage/tests/resolver/ResolverPlayground.py b/lib/portage/tests/resolver/ResolverPlayground.py
index d7fbe4390..cc0aa46e9 100644
--- a/lib/portage/tests/resolver/ResolverPlayground.py
+++ b/lib/portage/tests/resolver/ResolverPlayground.py
@@ -555,6 +555,9 @@ class ResolverPlayground(object):
 			"PORTAGE_REPOSITORIES": "\n".join("[%s]\n%s" % (repo_name, "\n".join("%s = %s" % (k, v) for k, v in repo_config.items())) for repo_name, repo_config in self._repositories.items())
 		}
 
+		if self.debug:
+			env["PORTAGE_DEBUG"] = "1"
+
 		trees = portage.create_trees(env=env, eprefix=self.eprefix,
 			**create_trees_kwargs)
 


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2020-02-10  2:29 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2020-02-10  2:29 UTC (permalink / raw
  To: gentoo-commits

commit:     b98dbb357b711f64c8fc1e305c5bca38be203f1d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 10 01:10:14 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 10 02:24:11 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b98dbb35

test_virtual_w3m: add realistic case, deps copied from real ebuilds

Since virtual/w3m-0 is not removed in the depclean case,
this test fails to reproduce bug 649622.

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

 lib/portage/tests/resolver/test_or_choices.py | 142 ++++++++++++++++++++++++++
 1 file changed, 142 insertions(+)

diff --git a/lib/portage/tests/resolver/test_or_choices.py b/lib/portage/tests/resolver/test_or_choices.py
index a7ede1fac..f31a5ff22 100644
--- a/lib/portage/tests/resolver/test_or_choices.py
+++ b/lib/portage/tests/resolver/test_or_choices.py
@@ -581,6 +581,148 @@ class OrChoicesTestCase(TestCase):
 			playground.cleanup()
 
 
+	def test_virtual_w3m_realistic(self):
+		"""
+		Test for bug 649622 with realistic www-client/w3m dependencies copied
+		from real ebuilds.
+		"""
+		ebuilds = {
+
+			'app-misc/neofetch-6.1.0': {
+				'EAPI': '7',
+				'RDEPEND': 'www-client/w3m'
+			},
+
+			'app-text/xmlto-0.0.28-r1' : {
+				'EAPI': '7',
+				'RDEPEND': '|| ( virtual/w3m www-client/lynx www-client/elinks )'
+			},
+
+			'mail-client/neomutt-20191207': {
+				'EAPI': '7',
+				'RDEPEND': '|| ( www-client/lynx www-client/w3m www-client/elinks )'
+			},
+
+			'www-client/elinks-0.13_pre_pre20180225' : {
+				'EAPI': '7',
+			},
+
+			'www-client/lynx-2.9.0_pre4' : {
+				'EAPI': '7',
+			},
+
+			'virtual/w3m-0' : {
+				'EAPI': '7',
+				'RDEPEND': '|| ( www-client/w3m www-client/w3mmee )'
+			},
+
+			'www-client/w3m-0.5.3_p20190105' : {
+				'EAPI': '7',
+			},
+
+			'www-client/w3mmee-0.3.2_p24-r10' : {
+				'EAPI': '7',
+			},
+
+			'x11-base/xorg-server-1.20.7' : {
+				'EAPI': '7',
+				'RDEPEND': '|| ( www-client/links www-client/lynx www-client/w3m ) app-text/xmlto',
+			}
+		}
+
+		installed = {
+
+			'app-misc/neofetch-6.1.0': {
+				'EAPI': '7',
+				'RDEPEND': 'www-client/w3m'
+			},
+
+			'app-text/xmlto-0.0.28-r1' : {
+				'EAPI': '7',
+				'RDEPEND': '|| ( virtual/w3m www-client/lynx www-client/elinks )'
+			},
+
+			'mail-client/neomutt-20191207': {
+				'EAPI': '7',
+				'RDEPEND': '|| ( www-client/lynx www-client/w3m www-client/elinks )'
+			},
+
+			'www-client/lynx-2.9.0_pre4' : {
+				'EAPI': '7',
+			},
+
+			'www-client/w3m-0.5.3_p20190105' : {
+				'EAPI': '7',
+			},
+
+			'x11-base/xorg-server-1.20.7' : {
+				'EAPI': '7',
+				'RDEPEND': '|| ( www-client/links www-client/lynx www-client/w3m ) app-text/xmlto',
+			}
+		}
+
+		world = ['app-misc/neofetch', 'mail-client/neomutt', 'www-client/lynx', 'x11-base/xorg-server']
+
+		test_cases = (
+
+			# Test for bug 649622 (with www-client/w3m installed via
+			# xorg-server dependency), where virtual/w3m was pulled in
+			# only to be removed by the next emerge --depclean.
+			ResolverPlaygroundTestCase(
+				['@world'],
+				options = {'--update': True, '--deep': True},
+				success = True,
+				mergelist=['virtual/w3m-0'],
+			),
+
+		)
+
+		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()
+
+
+		installed = dict(itertools.chain(installed.items(), {
+
+			'virtual/w3m-0' : {
+				'EAPI': '7',
+				'RDEPEND': '|| ( www-client/w3m www-client/w3mmee )'
+			},
+
+		}.items()))
+
+		test_cases = (
+
+			# Test for bug 649622, where virtual/w3m is removed by
+			# emerge --depclean immediately after it's installed
+			# by a world update. Since virtual/w3m-0 is not removed
+			# here, this case fails to reproduce bug 649622.
+			ResolverPlaygroundTestCase(
+				[],
+				options={'--depclean': True},
+				success=True,
+				cleanlist=[],
+			),
+
+		)
+
+		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()
+
+
 class OrChoicesLibpostprocTestCase(TestCase):
 
 	def testOrChoicesLibpostproc(self):


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2020-02-09 23:57 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2020-02-09 23:57 UTC (permalink / raw
  To: gentoo-commits

commit:     c3e9a0fe26434edcc2c034c6b863789eb6afbc34
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Feb  9 23:53:42 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb  9 23:56:16 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c3e9a0fe

test_virtual_w3m: test without www-client/w3m installed

Add test case showing that virtual/w3m-0 is not pulled in when
www-client/w3m is not installed and not in @world.

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

 lib/portage/tests/resolver/test_or_choices.py | 39 +++++++++++++++++++++++----
 1 file changed, 34 insertions(+), 5 deletions(-)

diff --git a/lib/portage/tests/resolver/test_or_choices.py b/lib/portage/tests/resolver/test_or_choices.py
index a295c9a22..a7ede1fac 100644
--- a/lib/portage/tests/resolver/test_or_choices.py
+++ b/lib/portage/tests/resolver/test_or_choices.py
@@ -455,18 +455,47 @@ class OrChoicesTestCase(TestCase):
 				'EAPI': '7',
 			},
 
+		}
+
+		world = ['app-text/xmlto', 'www-client/elinks', 'www-client/lynx']
+
+		test_cases = (
+
+			# Test for bug 649622 (without www-client/w3m installed),
+			# where virtual/w3m was pulled in only to be removed by the
+			# next emerge --depclean.
+			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()
+
+		installed = dict(itertools.chain(installed.items(), {
+
 			'www-client/w3m-0.5.3_p20190105' : {
 				'EAPI': '7',
 			},
 
-		}
-
-		world = ['app-text/xmlto', 'www-client/elinks', 'www-client/lynx']
+		}.items()))
 
 		test_cases = (
 
-			# Test for bug 649622, where virtual/w3m was pulled in only
-			# to be removed by the next emerge --depclean.
+			# Test for bug 649622 (with www-client/w3m installed),
+			# where virtual/w3m was pulled in only to be removed by the
+			# next emerge --depclean.
 			ResolverPlaygroundTestCase(
 				['@world'],
 				options = {'--update': True, '--deep': True},


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2020-02-09 23:15 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2020-02-09 23:15 UTC (permalink / raw
  To: gentoo-commits

commit:     21d9b579dc3fda2105caf3328ac5f0afbd80b9a2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Feb  9 23:04:50 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb  9 23:15:01 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=21d9b579

test_virtual_w3m: test with www-client/w3m in @world

Test for behavior reported in bug 649622 comment #10, where
depclean removed virtual/w3m-0 even though www-client/w3m
was in the world file. Since nothing is removed here, it
means that we have not reproduced the behavior reported in
this comment.

Bug: https://bugs.gentoo.org/649622#c19
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/test_or_choices.py | 29 +++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/lib/portage/tests/resolver/test_or_choices.py b/lib/portage/tests/resolver/test_or_choices.py
index 5679d0b5b..a295c9a22 100644
--- a/lib/portage/tests/resolver/test_or_choices.py
+++ b/lib/portage/tests/resolver/test_or_choices.py
@@ -523,6 +523,35 @@ class OrChoicesTestCase(TestCase):
 			playground.cleanup()
 
 
+		test_cases = (
+
+			# Test for behavior reported in bug 649622 comment #10, where
+			# depclean removed virtual/w3m-0 even though www-client/w3m
+			# was in the world file. Since nothing is removed here, it
+			# means that we have not reproduced the behavior reported in
+			# this comment.
+			ResolverPlaygroundTestCase(
+				[],
+				options={'--depclean': True},
+				success=True,
+				cleanlist=[],
+			),
+
+		)
+
+		world += ['www-client/w3m']
+
+		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()
+
+
 class OrChoicesLibpostprocTestCase(TestCase):
 
 	def testOrChoicesLibpostproc(self):


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2020-02-08  8:35 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2020-02-08  8:35 UTC (permalink / raw
  To: gentoo-commits

commit:     1aaed33429f390957514eb81b050cae8c7201d67
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  8 07:05:02 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Feb  8 08:24:04 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1aaed334

Add unit test for virtual/w3m depclean inconsistency (bug 649622)

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

 lib/portage/tests/resolver/test_or_choices.py | 114 +++++++++++++++++++++++++-
 1 file changed, 113 insertions(+), 1 deletion(-)

diff --git a/lib/portage/tests/resolver/test_or_choices.py b/lib/portage/tests/resolver/test_or_choices.py
index 10c613e39..f1cc75499 100644
--- a/lib/portage/tests/resolver/test_or_choices.py
+++ b/lib/portage/tests/resolver/test_or_choices.py
@@ -1,6 +1,8 @@
-# Copyright 2013-2015 Gentoo Foundation
+# Copyright 2013-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+import itertools
+
 from portage.tests import TestCase
 from portage.tests.resolver.ResolverPlayground import (ResolverPlayground,
 	ResolverPlaygroundTestCase)
@@ -407,6 +409,116 @@ class OrChoicesTestCase(TestCase):
 			playground.debug = False
 			playground.cleanup()
 
+	def test_virtual_w3m(self):
+		ebuilds = {
+
+			'app-text/xmlto-0.0.28-r1' : {
+				'EAPI': '7',
+				'RDEPEND': '|| ( virtual/w3m www-client/lynx www-client/elinks )'
+			},
+
+			'www-client/elinks-0.13_pre_pre20180225' : {
+				'EAPI': '7',
+			},
+
+			'www-client/lynx-2.9.0_pre4' : {
+				'EAPI': '7',
+			},
+
+			'virtual/w3m-0' : {
+				'EAPI': '7',
+				'RDEPEND': '|| ( www-client/w3m www-client/w3mmee )'
+			},
+
+			'www-client/w3m-0.5.3_p20190105' : {
+				'EAPI': '7',
+			},
+
+			'www-client/w3mmee-0.3.2_p24-r10' : {
+				'EAPI': '7',
+			},
+
+		}
+
+		installed = {
+
+			'app-text/xmlto-0.0.28-r1' : {
+				'EAPI': '7',
+				'RDEPEND': '|| ( virtual/w3m www-client/lynx www-client/elinks )'
+			},
+
+			'www-client/elinks-0.13_pre_pre20180225' : {
+				'EAPI': '7',
+			},
+
+			'www-client/lynx-2.9.0_pre4' : {
+				'EAPI': '7',
+			},
+
+			'www-client/w3m-0.5.3_p20190105' : {
+				'EAPI': '7',
+			},
+
+		}
+
+		world = ['app-text/xmlto', 'www-client/elinks', 'www-client/lynx']
+
+		test_cases = (
+
+			# Test for bug 649622, where virtual/w3m is installed only
+			# to be removed by the next emerge --depclean.
+			ResolverPlaygroundTestCase(
+				['@world'],
+				options = {'--update': True, '--deep': True},
+				success = True,
+				mergelist = ['virtual/w3m-0']
+			),
+
+		)
+
+		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()
+
+		installed = dict(itertools.chain(installed.items(), {
+
+			'virtual/w3m-0' : {
+				'EAPI': '7',
+				'RDEPEND': '|| ( www-client/w3m www-client/w3mmee )'
+			},
+
+		}.items()))
+
+		test_cases = (
+
+			# Test for bug 649622, where virtual/w3m is removed by
+			# emerge --depclean immediately after it's installed
+			# by a world update.
+			ResolverPlaygroundTestCase(
+				[],
+				options={'--depclean': True},
+				success=True,
+				cleanlist=['virtual/w3m-0', 'www-client/w3m-0.5.3_p20190105'],
+			),
+
+		)
+
+		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()
+
 
 class OrChoicesLibpostprocTestCase(TestCase):
 


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2020-02-01  4:48 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2020-02-01  4:48 UTC (permalink / raw
  To: gentoo-commits

commit:     1419af8b0830af4a93adda4a4b63d6bba8f3deb6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 31 03:25:26 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Feb  1 04:47:36 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1419af8b

Add test case that demonstrates bug 707108

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

 lib/portage/tests/resolver/test_or_choices.py | 123 ++++++++++++++++++++++++++
 1 file changed, 123 insertions(+)

diff --git a/lib/portage/tests/resolver/test_or_choices.py b/lib/portage/tests/resolver/test_or_choices.py
index a50ad0151..78946ccec 100644
--- a/lib/portage/tests/resolver/test_or_choices.py
+++ b/lib/portage/tests/resolver/test_or_choices.py
@@ -285,6 +285,129 @@ class OrChoicesTestCase(TestCase):
 			playground.debug = False
 			playground.cleanup()
 
+	def test_python_slot(self):
+		ebuilds = {
+
+			"dev-lang/python-3.8" : {
+				"EAPI": "7",
+				"SLOT": "3.8"
+			},
+
+			"dev-lang/python-3.7" : {
+				"EAPI": "7",
+				"SLOT": "3.7"
+			},
+
+			"dev-lang/python-3.6" : {
+				"EAPI": "7",
+				"SLOT": "3.6"
+			},
+
+			"app-misc/bar-1" : {
+				"EAPI": "7",
+				"IUSE": "python_targets_python3_6 +python_targets_python3_7",
+				"RDEPEND": "python_targets_python3_7? ( dev-lang/python:3.7 ) python_targets_python3_6? ( dev-lang/python:3.6 )"
+			},
+
+			"app-misc/foo-1" : {
+				"EAPI": "7",
+				"RDEPEND": "|| ( dev-lang/python:3.8 dev-lang/python:3.7 dev-lang/python:3.6 )"
+			},
+
+		}
+
+		installed = {
+
+			"dev-lang/python-3.7" : {
+				"EAPI": "7",
+				"SLOT": "3.7"
+			},
+
+			"app-misc/bar-1" : {
+				"EAPI": "7",
+				"IUSE": "python_targets_python3_6 +python_targets_python3_7",
+				"USE": "python_targets_python3_7",
+				"RDEPEND": "dev-lang/python:3.7"
+			},
+
+			"app-misc/foo-1" : {
+				"EAPI": "7",
+				"RDEPEND": "|| ( dev-lang/python:3.8 dev-lang/python:3.7 dev-lang/python:3.6 )"
+			},
+
+		}
+
+		world = ["app-misc/foo", "app-misc/bar"]
+
+		test_cases = (
+
+			ResolverPlaygroundTestCase(
+				["@world"],
+				options = {"--update": True, "--deep": True},
+				success = True,
+				mergelist = ['dev-lang/python-3.8']
+			),
+
+		)
+
+		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()
+
+		installed = {
+
+			"dev-lang/python-3.8" : {
+				"EAPI": "7",
+				"SLOT": "3.8"
+			},
+
+			"dev-lang/python-3.7" : {
+				"EAPI": "7",
+				"SLOT": "3.7"
+			},
+
+			"app-misc/bar-1" : {
+				"EAPI": "7",
+				"IUSE": "python_targets_python3_6 +python_targets_python3_7",
+				"USE": "python_targets_python3_7",
+				"RDEPEND": "dev-lang/python:3.7"
+			},
+
+			"app-misc/foo-1" : {
+				"EAPI": "7",
+				"RDEPEND": "|| ( dev-lang/python:3.8 dev-lang/python:3.7 dev-lang/python:3.6 )"
+			},
+
+		}
+
+		test_cases = (
+			# Demonstrate bug 707108, where a new python slot is erroneosly
+			# removed by emerge --depclean.
+			ResolverPlaygroundTestCase(
+				[],
+				options={"--depclean": True},
+				success=True,
+				cleanlist=['dev-lang/python-3.8'],
+			),
+		)
+
+		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()
+
+
 class OrChoicesLibpostprocTestCase(TestCase):
 
 	def testOrChoicesLibpostproc(self):


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2020-01-26  6:27 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2020-01-26  6:27 UTC (permalink / raw
  To: gentoo-commits

commit:     097cf78c22b3d523f701ab36f47714c604690b23
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 26 06:20:17 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jan 26 06:27:00 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=097cf78c

OrChoicesTestCase: split out bug 480736 libpostproc test case

This case will become an expected failure after bug 706278
is fixed. The packages that triggered bug 480736 not longer
exist.

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

 lib/portage/tests/resolver/test_or_choices.py | 115 +++++++++++++-------------
 1 file changed, 59 insertions(+), 56 deletions(-)

diff --git a/lib/portage/tests/resolver/test_or_choices.py b/lib/portage/tests/resolver/test_or_choices.py
index 63e62d010..c0316bfb3 100644
--- a/lib/portage/tests/resolver/test_or_choices.py
+++ b/lib/portage/tests/resolver/test_or_choices.py
@@ -78,62 +78,6 @@ class OrChoicesTestCase(TestCase):
 		finally:
 			playground.cleanup()
 
-	def testOrChoicesLibpostproc(self):
-		ebuilds = {
-			"media-video/ffmpeg-0.10" : {
-				"EAPI": "5",
-				"SLOT": "0.10"
-			},
-			"media-video/ffmpeg-1.2.2" : {
-				"EAPI": "5",
-				"SLOT": "0"
-			},
-			"media-libs/libpostproc-0.8.0.20121125" : {
-				"EAPI": "5"
-			},
-			"media-plugins/gst-plugins-ffmpeg-0.10.13_p201211-r1" : {
-				"EAPI": "5",
-				"RDEPEND" : "|| ( media-video/ffmpeg:0 media-libs/libpostproc )"
-			},
-		}
-
-		installed = {
-			"media-video/ffmpeg-0.10" : {
-				"EAPI": "5",
-				"SLOT": "0.10"
-			},
-			"media-libs/libpostproc-0.8.0.20121125" : {
-				"EAPI": "5"
-			},
-			"media-plugins/gst-plugins-ffmpeg-0.10.13_p201211-r1" : {
-				"EAPI": "5",
-				"RDEPEND" : "|| ( media-video/ffmpeg:0 media-libs/libpostproc )"
-			},
-		}
-
-		world = ["media-plugins/gst-plugins-ffmpeg"]
-
-		test_cases = (
-			# Demonstrate that libpostproc is preferred
-			# over ffmpeg:0 for bug #480736.
-			ResolverPlaygroundTestCase(
-				["@world"],
-				options = {"--update": True, "--deep": True},
-				success=True,
-				all_permutations = 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.cleanup()
-
-
 	def testInitiallyUnsatisfied(self):
 
 		ebuilds = {
@@ -340,3 +284,62 @@ class OrChoicesTestCase(TestCase):
 			# Disable debug so that cleanup works.
 			playground.debug = False
 			playground.cleanup()
+
+class OrChoicesLibpostprocTestCase(TestCase):
+
+	def testOrChoicesLibpostproc(self):
+
+		ebuilds = {
+			"media-video/ffmpeg-0.10" : {
+				"EAPI": "5",
+				"SLOT": "0.10"
+			},
+			"media-video/ffmpeg-1.2.2" : {
+				"EAPI": "5",
+				"SLOT": "0"
+			},
+			"media-libs/libpostproc-0.8.0.20121125" : {
+				"EAPI": "5"
+			},
+			"media-plugins/gst-plugins-ffmpeg-0.10.13_p201211-r1" : {
+				"EAPI": "5",
+				"RDEPEND" : "|| ( media-video/ffmpeg:0 media-libs/libpostproc )"
+			},
+		}
+
+		installed = {
+			"media-video/ffmpeg-0.10" : {
+				"EAPI": "5",
+				"SLOT": "0.10"
+			},
+			"media-libs/libpostproc-0.8.0.20121125" : {
+				"EAPI": "5"
+			},
+			"media-plugins/gst-plugins-ffmpeg-0.10.13_p201211-r1" : {
+				"EAPI": "5",
+				"RDEPEND" : "|| ( media-video/ffmpeg:0 media-libs/libpostproc )"
+			},
+		}
+
+		world = ["media-plugins/gst-plugins-ffmpeg"]
+
+		test_cases = (
+			# Demonstrate that libpostproc is preferred
+			# over ffmpeg:0 for bug #480736.
+			ResolverPlaygroundTestCase(
+				["@world"],
+				options = {"--update": True, "--deep": True},
+				success=True,
+				all_permutations = 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()


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2020-01-26  0:20 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2020-01-26  0:20 UTC (permalink / raw
  To: gentoo-commits

commit:     e2a2adf4b2ff7291fd12dce43c1d4c542c399a9f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 26 00:18:48 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jan 26 00:19:44 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e2a2adf4

MultirepoTestCase: package.keywords -> package.accept_keywords

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

 lib/portage/tests/resolver/test_multirepo.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/portage/tests/resolver/test_multirepo.py b/lib/portage/tests/resolver/test_multirepo.py
index dabec6af9..bdfcf2120 100644
--- a/lib/portage/tests/resolver/test_multirepo.py
+++ b/lib/portage/tests/resolver/test_multirepo.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2014 Gentoo Foundation
+# Copyright 2010-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase
@@ -246,7 +246,7 @@ class MultirepoTestCase(TestCase):
 			"dev-libs/B-2": { "DEPEND": "dev-libs/A[foo]", "EAPI": 2 },
 			"dev-libs/B-3": { "DEPEND": "dev-libs/A[-foo]", "EAPI": 2 },
 
-			#package.keywords test
+			#package.accept_keywords test
 			"dev-libs/C-1": { "KEYWORDS": "~x86" },
 			"dev-libs/C-1::repo1": { "KEYWORDS": "~x86" },
 
@@ -286,7 +286,7 @@ class MultirepoTestCase(TestCase):
 				(
 					"dev-libs/A::repo1 foo",
 				),
-			"package.keywords":
+			"package.accept_keywords":
 				(
 					"=dev-libs/C-1::test_repo",
 				),
@@ -332,7 +332,7 @@ class MultirepoTestCase(TestCase):
 				success = False,
 				check_repo_names = True),
 
-			#package.keywords test
+			#package.accept_keywords test
 			ResolverPlaygroundTestCase(
 				["dev-libs/C"],
 				success = True,


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2020-01-25 22:37 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2020-01-25 22:37 UTC (permalink / raw
  To: gentoo-commits

commit:     a4d832db2da41240558c424710a00435a797f0d6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 25 22:17:54 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jan 25 22:34:36 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a4d832db

OrUpgradeInstalledTestCase: add test for bug 706278

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

 .../tests/resolver/test_or_upgrade_installed.py    | 71 ++++++++++++++++++++++
 1 file changed, 71 insertions(+)

diff --git a/lib/portage/tests/resolver/test_or_upgrade_installed.py b/lib/portage/tests/resolver/test_or_upgrade_installed.py
index 7018e08de..c3efebf55 100644
--- a/lib/portage/tests/resolver/test_or_upgrade_installed.py
+++ b/lib/portage/tests/resolver/test_or_upgrade_installed.py
@@ -158,3 +158,74 @@ class OrUpgradeInstalledTestCase(TestCase):
 		finally:
 			playground.debug = False
 			playground.cleanup()
+
+
+	def test_llvm_slot_operator(self):
+		ebuilds = {
+			'media-libs/mesa-19.2.8': {
+				'EAPI': '7',
+				'RDEPEND': '''|| (
+					sys-devel/llvm:10
+					sys-devel/llvm:9
+					sys-devel/llvm:8
+					sys-devel/llvm:7
+				)
+				sys-devel/llvm:='''
+			},
+			'sys-devel/llvm-10': {
+				'EAPI': '7',
+				'KEYWORDS': '',
+				'SLOT': '10',
+			},
+			'sys-devel/llvm-9': {
+				'EAPI': '7',
+				'SLOT': '9',
+			},
+			'sys-devel/llvm-8': {
+				'EAPI': '7',
+				'SLOT': '8',
+			},
+		}
+
+		installed = {
+			'media-libs/mesa-19.2.8': {
+				'EAPI': '7',
+				'RDEPEND': '''|| (
+					sys-devel/llvm:10
+					sys-devel/llvm:9
+					sys-devel/llvm:8
+					sys-devel/llvm:7
+				)
+				sys-devel/llvm:8/8='''
+			},
+			'sys-devel/llvm-8': {
+				'EAPI': '7',
+				'SLOT': '8',
+			},
+		}
+
+		world = ['media-libs/mesa']
+
+		test_cases = (
+			# Demonstrate bug 706278, where there is a missed slot operator
+			# rebuild that prevents upgrade from llvm-8 to llvm-9.
+			ResolverPlaygroundTestCase(
+				['@world'],
+				options={'--update': True, '--deep': True},
+				success=True,
+				mergelist=[],
+				#mergelist=['sys-devel/llvm-9'],
+			),
+		)
+
+		playground = ResolverPlayground(debug=False,
+			ebuilds=ebuilds, installed=installed, world=world)
+
+		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()


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2020-01-21  2:37 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2020-01-21  2:37 UTC (permalink / raw
  To: gentoo-commits

commit:     e5878170638a091db1331df7e7922c8a14e29e86
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 21 01:59:30 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jan 21 02:35:43 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e5878170

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 <AT> gentoo.org>

 .../tests/resolver/test_circular_choices.py        | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)

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()


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2019-12-25  8:18 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2019-12-25  8:18 UTC (permalink / raw
  To: gentoo-commits

commit:     7dc4131eca73aee2a78fd5c4339cb41760f7a54f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 25 07:55:24 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Dec 25 08:09:22 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7dc4131e

MergeOrderTestCase: update circ-buildtime mergelist for bug 690436

Update mergelist for the circ-buildtime test case so that it will pass
after the fix for bug 690436, and also add a commented merge order
assertion which will succeed after the fix.

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

 lib/portage/tests/resolver/test_merge_order.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/portage/tests/resolver/test_merge_order.py b/lib/portage/tests/resolver/test_merge_order.py
index 5d000d12b..74e826661 100644
--- a/lib/portage/tests/resolver/test_merge_order.py
+++ b/lib/portage/tests/resolver/test_merge_order.py
@@ -1,4 +1,4 @@
-# Copyright 2011-2013 Gentoo Foundation
+# Copyright 2011-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import portage
@@ -319,7 +319,12 @@ class MergeOrderTestCase(TestCase):
 				["app-misc/some-app-c", "app-misc/circ-buildtime-a"],
 				success = True,
 				ambiguous_merge_order = True,
-				mergelist = [("app-misc/circ-buildtime-b-1", "app-misc/circ-buildtime-c-1"), "app-misc/circ-buildtime-a-1", "app-misc/some-app-c-1"]),
+				# The following merge order assertion reflects optimal order for
+				# a circular relationship which is DEPEND in one direction and
+				# RDEPEND in the other. The assertion currently fails, and the
+				# patch for bug 690436 will fix it.
+				#merge_order_assertions = (("app-misc/circ-buildtime-a-1", "app-misc/circ-buildtime-c-1"),),
+				mergelist = [("app-misc/circ-buildtime-b-1", "app-misc/circ-buildtime-c-1", "app-misc/circ-buildtime-a-1"), "app-misc/some-app-c-1"]),
 			# Test optimal merge order for a circular dep that is
 			# RDEPEND in one direction and PDEPEND in the other.
 			ResolverPlaygroundTestCase(


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2019-12-22  0:35 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2019-12-22  0:35 UTC (permalink / raw
  To: gentoo-commits

commit:     ff057e1002529be8b349fd7a1a3179141a7fda0e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 22 00:33:50 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec 22 00:34:28 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ff057e10

testVirtualCmakeBootstrapUseConditional: use RDEPEND for virtual/cmake

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/test_circular_choices.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/portage/tests/resolver/test_circular_choices.py b/lib/portage/tests/resolver/test_circular_choices.py
index ef9e88eac..d963280b7 100644
--- a/lib/portage/tests/resolver/test_circular_choices.py
+++ b/lib/portage/tests/resolver/test_circular_choices.py
@@ -63,7 +63,7 @@ class CircularJsoncppCmakeBootstrapTestCase(TestCase):
 			'virtual/cmake-0': {
 				'EAPI': '7',
 				'IUSE': '+bootstrap',
-				'BDEPEND': 'bootstrap? ( dev-util/cmake-bootstrap ) !bootstrap? ( dev-util/cmake )'
+				'RDEPEND': 'bootstrap? ( dev-util/cmake-bootstrap ) !bootstrap? ( dev-util/cmake )'
 			},
 		}
 


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2019-12-22  0:28 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2019-12-22  0:28 UTC (permalink / raw
  To: gentoo-commits

commit:     ae3e58e83b0a3e75990fd2cef04a0c14b3162650
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 22 00:24:47 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec 22 00:26:17 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ae3e58e8

testVirtualCmakeBootstrapUseConditional: split out virtual/cmake

If we split the dependency conditional on the bootstrap USE flag into a
virtual, then it suffices to rebuild the virtual with USE=-bootstrap
instead of rebuilding jsoncpp:

 * Error: circular dependencies:

(dev-libs/jsoncpp-1.9.2:0/0::test_repo, ebuild scheduled for merge) depends on
 (virtual/cmake-0:0/0::test_repo, ebuild scheduled for merge) (buildtime)
  (dev-util/cmake-3.16.2:0/0::test_repo, ebuild scheduled for merge) (buildtime)
   (dev-libs/jsoncpp-1.9.2:0/0::test_repo, ebuild scheduled for merge) (buildtime_slot_op)

It might be possible to break this cycle
by applying the following change:
- virtual/cmake-0 (Change USE: +bootstrap)

Note that this change can be reverted, once the package has been installed.

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

 lib/portage/tests/resolver/test_circular_choices.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/portage/tests/resolver/test_circular_choices.py b/lib/portage/tests/resolver/test_circular_choices.py
index 366f2bc27..ef9e88eac 100644
--- a/lib/portage/tests/resolver/test_circular_choices.py
+++ b/lib/portage/tests/resolver/test_circular_choices.py
@@ -51,8 +51,7 @@ class CircularJsoncppCmakeBootstrapTestCase(TestCase):
 		ebuilds = {
 			'dev-libs/jsoncpp-1.9.2': {
 				'EAPI': '7',
-				'IUSE': '+bootstrap',
-				'BDEPEND': 'bootstrap? ( dev-util/cmake-bootstrap ) !bootstrap? ( dev-util/cmake )'
+				'BDEPEND': 'virtual/cmake'
 			},
 			'dev-util/cmake-bootstrap-3.16.2': {
 				'EAPI': '7',
@@ -61,13 +60,18 @@ class CircularJsoncppCmakeBootstrapTestCase(TestCase):
 				'EAPI': '7',
 				'BDEPEND': '>=dev-libs/jsoncpp-0.6.0_rc2:0=',
 			},
+			'virtual/cmake-0': {
+				'EAPI': '7',
+				'IUSE': '+bootstrap',
+				'BDEPEND': 'bootstrap? ( dev-util/cmake-bootstrap ) !bootstrap? ( dev-util/cmake )'
+			},
 		}
 
 		test_cases = (
 			# Solve bug 703440 with a dependency conditional on the bootstrap USE flag.
 			ResolverPlaygroundTestCase(
 				['dev-util/cmake'],
-				mergelist = ['dev-util/cmake-bootstrap-3.16.2', 'dev-libs/jsoncpp-1.9.2', 'dev-util/cmake-3.16.2'],
+				mergelist = ['dev-util/cmake-bootstrap-3.16.2', 'virtual/cmake-0', 'dev-libs/jsoncpp-1.9.2', 'dev-util/cmake-3.16.2'],
 				success = True,
 			),
 		)


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2019-12-21 23:54 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2019-12-21 23:54 UTC (permalink / raw
  To: gentoo-commits

commit:     4e83e35467741535463c2f9284dcf21ab4229391
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 21 22:55:34 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 21 23:54:15 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4e83e354

test_circular_choices: add cases for bug 703440

The testCircularJsoncppCmakeBootstrapOrDeps method fails due to circular
dependencies triggered when it ignores cmake-bootstrap in order to
eliminate redundant packages.

Meanwhile, the testVirtualCmakeBootstrapUseConditional method solves the
problem by using a dependency conditional on the bootstrap USE flag.

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

 .../tests/resolver/test_circular_choices.py        | 75 ++++++++++++++++++++++
 1 file changed, 75 insertions(+)

diff --git a/lib/portage/tests/resolver/test_circular_choices.py b/lib/portage/tests/resolver/test_circular_choices.py
index 418173689..366f2bc27 100644
--- a/lib/portage/tests/resolver/test_circular_choices.py
+++ b/lib/portage/tests/resolver/test_circular_choices.py
@@ -5,6 +5,81 @@ from portage.tests import TestCase
 from portage.tests.resolver.ResolverPlayground import (ResolverPlayground,
 	ResolverPlaygroundTestCase)
 
+class CircularJsoncppCmakeBootstrapTestCase(TestCase):
+
+	def testCircularJsoncppCmakeBootstrapOrDeps(self):
+
+		ebuilds = {
+			'dev-libs/jsoncpp-1.9.2': {
+				'EAPI': '7',
+				'BDEPEND': '|| ( dev-util/cmake-bootstrap dev-util/cmake )'
+			},
+			'dev-util/cmake-bootstrap-3.16.2': {
+				'EAPI': '7',
+			},
+			'dev-util/cmake-3.16.2': {
+				'EAPI': '7',
+				'BDEPEND': '>=dev-libs/jsoncpp-0.6.0_rc2:0=',
+			},
+		}
+
+		test_cases = (
+			# Demonstrate bug 703440. It ignores cmake-bootstrap in order to eliminate redundant packages.
+			#
+			#  * Error: circular dependencies:
+			#
+			# (dev-libs/jsoncpp-1.9.2:0/0::test_repo, ebuild scheduled for merge) depends on
+			#  (dev-util/cmake-3.16.2:0/0::test_repo, ebuild scheduled for merge) (buildtime)
+			#    (dev-libs/jsoncpp-1.9.2:0/0::test_repo, ebuild scheduled for merge) (buildtime_slot_op)
+			ResolverPlaygroundTestCase(
+				['dev-util/cmake'],
+				circular_dependency_solutions = {},
+				success = False,
+			),
+		)
+
+		playground = ResolverPlayground(ebuilds=ebuilds)
+		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.cleanup()
+
+	def testVirtualCmakeBootstrapUseConditional(self):
+
+		ebuilds = {
+			'dev-libs/jsoncpp-1.9.2': {
+				'EAPI': '7',
+				'IUSE': '+bootstrap',
+				'BDEPEND': 'bootstrap? ( dev-util/cmake-bootstrap ) !bootstrap? ( dev-util/cmake )'
+			},
+			'dev-util/cmake-bootstrap-3.16.2': {
+				'EAPI': '7',
+			},
+			'dev-util/cmake-3.16.2': {
+				'EAPI': '7',
+				'BDEPEND': '>=dev-libs/jsoncpp-0.6.0_rc2:0=',
+			},
+		}
+
+		test_cases = (
+			# Solve bug 703440 with a dependency conditional on the bootstrap USE flag.
+			ResolverPlaygroundTestCase(
+				['dev-util/cmake'],
+				mergelist = ['dev-util/cmake-bootstrap-3.16.2', 'dev-libs/jsoncpp-1.9.2', 'dev-util/cmake-3.16.2'],
+				success = True,
+			),
+		)
+
+		playground = ResolverPlayground(ebuilds=ebuilds)
+		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.cleanup()
+
 class CircularChoicesTestCase(TestCase):
 
 	def testDirectCircularDependency(self):


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2019-11-16  9:57 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2019-11-16  9:57 UTC (permalink / raw
  To: gentoo-commits

commit:     c5f9cbdc45be302a04bda52612d12a891667103c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 16 09:53:05 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Nov 16 09:53:56 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c5f9cbdc

ResolverPlayground: create installed ebuild + environment.bz2

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/ResolverPlayground.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/portage/tests/resolver/ResolverPlayground.py b/lib/portage/tests/resolver/ResolverPlayground.py
index 22d54e251..3d48c244f 100644
--- a/lib/portage/tests/resolver/ResolverPlayground.py
+++ b/lib/portage/tests/resolver/ResolverPlayground.py
@@ -1,6 +1,7 @@
 # Copyright 2010-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+import bz2
 from itertools import permutations
 import fnmatch
 import sys
@@ -332,6 +333,17 @@ class ResolverPlayground(object):
 				with open(os.path.join(vdb_pkg_dir, k), "w") as f:
 					f.write("%s\n" % v)
 
+			ebuild_path = os.path.join(vdb_pkg_dir, a.cpv.split("/")[1] + ".ebuild")
+			with open(ebuild_path, "w") as f:
+				f.write('EAPI="%s"\n' % metadata.pop('EAPI', '0'))
+				for k, v in metadata.items():
+					f.write('%s="%s"\n' % (k, v))
+
+			env_path = os.path.join(vdb_pkg_dir, 'environment.bz2')
+			with bz2.BZ2File(env_path, mode='w') as f:
+				with open(ebuild_path, 'rb') as inputfile:
+					f.write(inputfile.read())
+
 	def _create_profile(self, ebuilds, installed, profile, repo_configs, user_config, sets):
 
 		user_config_dir = os.path.join(self.eroot, USER_CONFIG_PATH)


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2019-10-21  8:26 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2019-10-21  8:26 UTC (permalink / raw
  To: gentoo-commits

commit:     72c3a6d7179d9b18b8681a958a86af95889e6d88
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 21 08:20:45 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 21 08:23:27 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=72c3a6d7

SlotOperatorRuntimePkgMaskTestCase: increase --backtrack to 14

Hopefully this solves an occasional travis-ci test failure,
since the increase to 13 in c510f715b748 did not solve it.
Curiously, both observed failures were with python3.5.

See: https://travis-ci.org/gentoo/portage/jobs/600277643
See: https://travis-ci.org/gentoo/portage/jobs/585109030
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/test_slot_operator_runtime_pkg_mask.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/portage/tests/resolver/test_slot_operator_runtime_pkg_mask.py b/lib/portage/tests/resolver/test_slot_operator_runtime_pkg_mask.py
index 4a028def3..affe33f89 100644
--- a/lib/portage/tests/resolver/test_slot_operator_runtime_pkg_mask.py
+++ b/lib/portage/tests/resolver/test_slot_operator_runtime_pkg_mask.py
@@ -110,7 +110,7 @@ class SlotOperatorRuntimePkgMaskTestCase(TestCase):
 			ResolverPlaygroundTestCase(
 				["=app-misc/meta-pkg-2"],
 				options = {
-					"--backtrack": 13,
+					"--backtrack": 14,
 				},
 				success = True,
 				ambiguous_merge_order = True,


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2019-10-11  4:00 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2019-10-11  4:00 UTC (permalink / raw
  To: gentoo-commits

commit:     bfc7b14852da5a2c6274e2116b81e9f2abfcb962
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 11 03:57:10 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 11 04:00:17 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=bfc7b148

tests/resolver: specify --autounmask when appropriate

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/test_autounmask.py             |  4 +++-
 lib/portage/tests/resolver/test_keywords.py               | 15 ++++++++++++++-
 .../tests/resolver/test_slot_operator_autounmask.py       |  4 ++--
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/lib/portage/tests/resolver/test_autounmask.py b/lib/portage/tests/resolver/test_autounmask.py
index 809d42104..64718dbf9 100644
--- a/lib/portage/tests/resolver/test_autounmask.py
+++ b/lib/portage/tests/resolver/test_autounmask.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2018 Gentoo Foundation
+# Copyright 2010-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase
@@ -579,12 +579,14 @@ class AutounmaskTestCase(TestCase):
 			ResolverPlaygroundTestCase(
 				["dev-libs/B"],
 				success=False,
+				options={"--autounmask": True},
 				mergelist=["dev-libs/A-2", "dev-libs/B-1"],
 				needed_p_mask_changes=set(["dev-libs/A-2"])),
 
 			ResolverPlaygroundTestCase(
 				["dev-libs/C"],
 				success=False,
+				options={"--autounmask": True},
 				mergelist=["dev-libs/A-9999", "dev-libs/C-1"],
 				unstable_keywords=set(["dev-libs/A-9999"]),
 				needed_p_mask_changes=set(["dev-libs/A-9999"])),

diff --git a/lib/portage/tests/resolver/test_keywords.py b/lib/portage/tests/resolver/test_keywords.py
index d59ea5881..7989bbac5 100644
--- a/lib/portage/tests/resolver/test_keywords.py
+++ b/lib/portage/tests/resolver/test_keywords.py
@@ -1,4 +1,4 @@
-# Copyright 2011 Gentoo Foundation
+# Copyright 2011-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase
@@ -37,6 +37,7 @@ class KeywordsTestCase(TestCase):
 			ResolverPlaygroundTestCase(
 				['app-misc/B'],
 				success = False,
+				options={'--autounmask': True},
 				unstable_keywords = ('app-misc/B-1',),
 				mergelist = ['app-misc/B-1']),
 
@@ -48,24 +49,28 @@ class KeywordsTestCase(TestCase):
 			ResolverPlaygroundTestCase(
 				['app-misc/D'],
 				success = False,
+				options={'--autounmask': True},
 				unstable_keywords = ('app-misc/D-1',),
 				mergelist = ['app-misc/D-1']),
 
 			ResolverPlaygroundTestCase(
 				['app-misc/E'],
 				success = False,
+				options={'--autounmask': True},
 				unstable_keywords = ('app-misc/E-1',),
 				mergelist = ['app-misc/E-1']),
 
 			ResolverPlaygroundTestCase(
 				['app-misc/F'],
 				success = False,
+				options={'--autounmask': True},
 				unstable_keywords = ('app-misc/F-1',),
 				mergelist = ['app-misc/F-1']),
 
 			ResolverPlaygroundTestCase(
 				['app-misc/G'],
 				success = False,
+				options={'--autounmask': True},
 				unstable_keywords = ('app-misc/G-1',),
 				mergelist = ['app-misc/G-1']),
 		)
@@ -109,6 +114,7 @@ class KeywordsTestCase(TestCase):
 			ResolverPlaygroundTestCase(
 				['app-misc/B'],
 				success = False,
+				options={'--autounmask': True},
 				unstable_keywords = ('app-misc/B-1',),
 				mergelist = ['app-misc/B-1']),
 
@@ -120,6 +126,7 @@ class KeywordsTestCase(TestCase):
 			ResolverPlaygroundTestCase(
 				['app-misc/D'],
 				success = False,
+				options={'--autounmask': True},
 				unstable_keywords = ('app-misc/D-1',),
 				mergelist = ['app-misc/D-1']),
 
@@ -131,12 +138,14 @@ class KeywordsTestCase(TestCase):
 			ResolverPlaygroundTestCase(
 				['app-misc/F'],
 				success = False,
+				options={'--autounmask': True},
 				unstable_keywords = ('app-misc/F-1',),
 				mergelist = ['app-misc/F-1']),
 
 			ResolverPlaygroundTestCase(
 				['app-misc/G'],
 				success = False,
+				options={'--autounmask': True},
 				unstable_keywords = ('app-misc/G-1',),
 				mergelist = ['app-misc/G-1']),
 		)
@@ -195,18 +204,21 @@ class KeywordsTestCase(TestCase):
 			ResolverPlaygroundTestCase(
 				['app-misc/E'],
 				success = False,
+				options={'--autounmask': True},
 				unstable_keywords = ('app-misc/E-1',),
 				mergelist = ['app-misc/E-1']),
 
 			ResolverPlaygroundTestCase(
 				['app-misc/F'],
 				success = False,
+				options={'--autounmask': True},
 				unstable_keywords = ('app-misc/F-1',),
 				mergelist = ['app-misc/F-1']),
 
 			ResolverPlaygroundTestCase(
 				['app-misc/G'],
 				success = False,
+				options={'--autounmask': True},
 				unstable_keywords = ('app-misc/G-1',),
 				mergelist = ['app-misc/G-1']),
 		)
@@ -275,6 +287,7 @@ class KeywordsTestCase(TestCase):
 			ResolverPlaygroundTestCase(
 				['app-misc/G'],
 				success = False,
+				options={'--autounmask': True},
 				unstable_keywords = ('app-misc/G-1',),
 				mergelist = ['app-misc/G-1']),
 		)

diff --git a/lib/portage/tests/resolver/test_slot_operator_autounmask.py b/lib/portage/tests/resolver/test_slot_operator_autounmask.py
index 42efa6682..5ab8e1f67 100644
--- a/lib/portage/tests/resolver/test_slot_operator_autounmask.py
+++ b/lib/portage/tests/resolver/test_slot_operator_autounmask.py
@@ -73,14 +73,14 @@ class SlotOperatorAutoUnmaskTestCase(TestCase):
 
 			ResolverPlaygroundTestCase(
 				["dev-libs/icu"],
-				options = {"--oneshot": True, "--usepkg": True},
+				options = {"--autounmask": True, "--oneshot": True, "--usepkg": True},
 				success = False,
 				mergelist = ["[binary]dev-libs/icu-49", "dev-libs/libxml2-2.7.8" ],
 				unstable_keywords = ['dev-libs/libxml2-2.7.8']),
 
 			ResolverPlaygroundTestCase(
 				["dev-libs/icu"],
-				options = {"--oneshot": True, "--usepkgonly": True},
+				options = {"--autounmask": True, "--oneshot": True, "--usepkgonly": True},
 				success = True,
 				mergelist = ["[binary]dev-libs/icu-4.8"]),
 


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2019-09-15  3:36 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2019-09-15  3:36 UTC (permalink / raw
  To: gentoo-commits

commit:     c510f715b748a604c47fb78ed4796bf0391bcfdd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 15 03:34:07 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 15 03:35:48 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c510f715

SlotOperatorRuntimePkgMaskTestCase: increase --backtrack to 13

Hopefully this solves an occasional travis-ci test failure like this:

AssertionError: False != True : atoms: (=app-misc/meta-pkg-2), key: slot_collision_solutions, expected: None, got: []
atoms: (=app-misc/meta-pkg-2), key: success, expected: True, got: False

See: https://travis-ci.org/gentoo/portage/jobs/585109030
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/test_slot_operator_runtime_pkg_mask.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/portage/tests/resolver/test_slot_operator_runtime_pkg_mask.py b/lib/portage/tests/resolver/test_slot_operator_runtime_pkg_mask.py
index f8b53e2b5..4a028def3 100644
--- a/lib/portage/tests/resolver/test_slot_operator_runtime_pkg_mask.py
+++ b/lib/portage/tests/resolver/test_slot_operator_runtime_pkg_mask.py
@@ -1,4 +1,4 @@
-# Copyright 2017 Gentoo Foundation
+# Copyright 2017-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase
@@ -110,7 +110,7 @@ class SlotOperatorRuntimePkgMaskTestCase(TestCase):
 			ResolverPlaygroundTestCase(
 				["=app-misc/meta-pkg-2"],
 				options = {
-					"--backtrack": 12,
+					"--backtrack": 13,
 				},
 				success = True,
 				ambiguous_merge_order = True,


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2019-09-12 19:43 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2019-09-12 19:43 UTC (permalink / raw
  To: gentoo-commits

commit:     524aa791f28ffcc1df921d8a8a9c111b7e359099
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 12 19:40:44 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Sep 12 19:42:37 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=524aa791

VirtualCircularChoicesTestCase: remove todo flag (bug 384107)

This test passes since the fix for bug 639346 in commit
09185309aad49b83f29ef94b11318998e520e138.

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

 lib/portage/tests/resolver/test_circular_choices.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lib/portage/tests/resolver/test_circular_choices.py b/lib/portage/tests/resolver/test_circular_choices.py
index 33b730627..418173689 100644
--- a/lib/portage/tests/resolver/test_circular_choices.py
+++ b/lib/portage/tests/resolver/test_circular_choices.py
@@ -1,4 +1,4 @@
-# Copyright 2011 Gentoo Foundation
+# Copyright 2011-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase
@@ -34,9 +34,6 @@ class CircularChoicesTestCase(TestCase):
 class VirtualCircularChoicesTestCase(TestCase):
 	def testDirectVirtualCircularDependency(self):
 
-		# Bug #384107
-		self.todo = True
-
 		ebuilds = {
 			"dev-java/icedtea-6.1.10.3": { "SLOT" : "6", "DEPEND": "virtual/jdk" },
 			"dev-java/icedtea6-bin-1.10.3": {},


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2019-09-12 19:05 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2019-09-12 19:05 UTC (permalink / raw
  To: gentoo-commits

commit:     54cab2dea3c55cbcd3a9bc2831c0ad25b12f12fa
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 12 18:59:09 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Sep 12 19:03:04 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=54cab2de

SlotConflictMaskUpdateTestCase: remove todo flag (bug 693242)

This test passes since the fix premature backtracking termination in
commit bb0bb4104b0d6cab16abce9cd6e1683c0b6d5c8d.

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

 lib/portage/tests/resolver/test_slot_conflict_mask_update.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lib/portage/tests/resolver/test_slot_conflict_mask_update.py b/lib/portage/tests/resolver/test_slot_conflict_mask_update.py
index a90eeac29..37e969828 100644
--- a/lib/portage/tests/resolver/test_slot_conflict_mask_update.py
+++ b/lib/portage/tests/resolver/test_slot_conflict_mask_update.py
@@ -1,4 +1,4 @@
-# Copyright 2013 Gentoo Foundation
+# Copyright 2013-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase
@@ -13,9 +13,6 @@ class SlotConflictMaskUpdateTestCase(TestCase):
 		in first. This is not always a good idea. Mask the highest version instead.
 		"""
 
-		
-		self.todo = True
-
 		ebuilds = {
 			"dev-libs/A-1": { "DEPEND": "=dev-libs/C-1 dev-libs/B" },
 			"dev-libs/B-1": { "DEPEND": "=dev-libs/C-1" },


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2019-01-20 19:27 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2019-01-20 19:27 UTC (permalink / raw
  To: gentoo-commits

commit:     e0c2af5078fc481c21dc4f4abfa0d61d6ed48e84
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 20 19:22:04 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jan 20 19:24:31 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e0c2af50

ResolverPlayground: add chgrp to essential_binaries

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/ResolverPlayground.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/portage/tests/resolver/ResolverPlayground.py b/lib/portage/tests/resolver/ResolverPlayground.py
index 0d6340dc0..fc754fb42 100644
--- a/lib/portage/tests/resolver/ResolverPlayground.py
+++ b/lib/portage/tests/resolver/ResolverPlayground.py
@@ -86,6 +86,7 @@ class ResolverPlayground(object):
 				"basename",
 				"bzip2",
 				"cat",
+				"chgrp",
 				"chmod",
 				"chown",
 				"cp",


^ permalink raw reply related	[flat|nested] 56+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
@ 2018-12-30  2:34 Zac Medico
  0 siblings, 0 replies; 56+ messages in thread
From: Zac Medico @ 2018-12-30  2:34 UTC (permalink / raw
  To: gentoo-commits

commit:     17cb113abf2b155b7b1f2955f7eed54f335badb0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 30 00:21:17 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec 30 00:59:46 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=17cb113a

ResolverPlayground: exclude internal wrappers from essential_binaries PATH

Ensure that essential_binaries symlinks do not refer to internal
wrapper scripts, in order to avoid infinite recursion. Use the
same ebuild-helpers pattern as the portageq wrapper script since
daeb75b345c4433218ab9e7a5319e8914092f048.

Fixes: 1b5edbb5ec70 ("_doebuild_path: do not use host PATH by default and prepend EPREFIX PATH")
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/ResolverPlayground.py | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/lib/portage/tests/resolver/ResolverPlayground.py b/lib/portage/tests/resolver/ResolverPlayground.py
index 3997ad26e..626a1f064 100644
--- a/lib/portage/tests/resolver/ResolverPlayground.py
+++ b/lib/portage/tests/resolver/ResolverPlayground.py
@@ -108,8 +108,21 @@ class ResolverPlayground(object):
 				"uniq",
 				"xargs",
 			)
-			for x in essential_binaries:
-				os.symlink(find_binary(x), os.path.join(eubin, x))
+			# Exclude internal wrappers from PATH lookup.
+			orig_path = os.environ['PATH']
+			included_paths = []
+			for path in orig_path.split(':'):
+				if path and not fnmatch.fnmatch(path, '*/portage/*/ebuild-helpers*'):
+					included_paths.append(path)
+			try:
+				os.environ['PATH'] = ':'.join(included_paths)
+				for x in essential_binaries:
+					path = find_binary(x)
+					if path is None:
+						raise portage.exception.CommandNotFound(x)
+					os.symlink(path, os.path.join(eubin, x))
+			finally:
+				os.environ['PATH'] = orig_path
 		else:
 			self.eprefix = normalize_path(eprefix)
 


^ permalink raw reply related	[flat|nested] 56+ messages in thread

end of thread, other threads:[~2024-05-26 18:58 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-03 23:28 [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/ Zac Medico
  -- strict thread matches above, loose matches on Subject: below --
2024-05-26 18:58 Zac Medico
2024-05-26 18:48 Zac Medico
2024-02-09 21:40 Zac Medico
2023-12-24 19:30 Zac Medico
2023-11-28 22:26 Sam James
2023-11-18  1:16 Zac Medico
2023-06-19 21:17 Sam James
2023-06-16  3:34 Sam James
2023-06-16  3:34 Sam James
2023-05-26 15:45 Sam James
2023-05-26 15:45 Sam James
2023-05-26 15:45 Sam James
2023-02-19 19:19 Sam James
2023-01-02 20:45 Mike Gilbert
2022-07-25 22:01 Zac Medico
2022-07-25 20:44 Mike Gilbert
2022-02-14  0:14 Zac Medico
2021-05-24  6:33 Zac Medico
2021-03-28  6:21 Zac Medico
2021-03-06  9:53 Zac Medico
2021-03-01  8:56 Zac Medico
2021-03-01  6:43 Zac Medico
2021-02-23 22:39 Zac Medico
2021-01-11  3:40 Zac Medico
2020-12-02 17:33 Zac Medico
2020-11-15  5:56 Zac Medico
2020-09-19 20:28 Zac Medico
2020-08-30 22:39 Zac Medico
2020-08-03 23:28 Zac Medico
2020-08-03 23:28 Zac Medico
2020-08-03 21:42 Zac Medico
2020-08-03 19:30 Zac Medico
2020-04-11 23:50 Zac Medico
2020-02-10  3:19 Zac Medico
2020-02-10  2:29 Zac Medico
2020-02-09 23:57 Zac Medico
2020-02-09 23:15 Zac Medico
2020-02-08  8:35 Zac Medico
2020-02-01  4:48 Zac Medico
2020-01-26  6:27 Zac Medico
2020-01-26  0:20 Zac Medico
2020-01-25 22:37 Zac Medico
2020-01-21  2:37 Zac Medico
2019-12-25  8:18 Zac Medico
2019-12-22  0:35 Zac Medico
2019-12-22  0:28 Zac Medico
2019-12-21 23:54 Zac Medico
2019-11-16  9:57 Zac Medico
2019-10-21  8:26 Zac Medico
2019-10-11  4:00 Zac Medico
2019-09-15  3:36 Zac Medico
2019-09-12 19:43 Zac Medico
2019-09-12 19:05 Zac Medico
2019-01-20 19:27 Zac Medico
2018-12-30  2:34 Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox